Forum Moderators: open

Message Too Old, No Replies

I need some serious help!

Image scrollbar

         

ssteele

7:44 pm on Sep 14, 2004 (gmt 0)



I am trying to create a horizontal image scrollbar in Flash- so that as you press down on the 'dragger' and pull to the right the images above move to the left. I have it working but only if everything sits on frame 1. If I add any intro frames or have a button going to the frame where the scrollbar sits, it does not work. I can still drag the 'dragger' but the images do not move along 'x'.

Here is what I have (this one is working)
-3 layers, keyed on Frame 1 (code, a mask, graphics)

Code :
//
xpos = GetProperty("scroll",_x) ;
setProperty("imagearea", _x, -1.75*xpos);
//
'imagearea' being the images that are scrolling along 'x'.

and on my dragger I have the following code:
//
on (press) {
startDrag("/scroll", false, 9, 247, 165, 247);
}
on (release, releaseOutside, rollOut) {
stopDrag();
}
//

Now if I put all of this on frame 20 (let's say) it doesn't work anymore. Do I have to create an onEnterFrame function? If so can someone help?
Much Appreciated.

der_Martin

5:51 pm on Sep 22, 2004 (gmt 0)



one example:

create two movies, one called "movie", the other (maybe) call "dragger". Then put a button into "dragger" with that action:

on (press) {
startDrag (this);
}
on (release, releaseOutside) {
_root.movie._x = _root._width-_x;
stopDrag ();
}

this is just the most primitive way, you may put it into an loop in "dragger" like this :

frame 2 : gotoAndPlay (1);
frame 4 : _root.movie._x = _root._width-_x;
gotoAndPlay (3);

the buttons code:

on (press) {
gotoAndPlay (3);
startDrag (this);
}
on (release, releaseOutside) {
gotoAndPlay (1);
stopDrag ();
}