rocknbil

msg:3602956 | 3:03 pm on Mar 17, 2008 (gmt 0) |
Create your filmstrip as a symbol. When either edge of the filmstrip reaches the edge of the viewport, attach a new copy of the strip and set that edge next to the one currently on stage. Be sure to remove movie clips that have completely moved off the stage.
|
mightymid

msg:3603010 | 3:52 pm on Mar 17, 2008 (gmt 0) |
Thanks. On further thought, maybe what I really want to do is force the filmstrip to stop scrolling when the end enters the viewport. Is there a way to achieve THAT by modifying the script posted above?
|
rocknbil

msg:3607529 | 7:17 pm on Mar 21, 2008 (gmt 0) |
Well, think of the logic. If you're moving left, and the right edge meets the right edge of the viewport, stop scrolling. goleft.onPress = function() { filmstrip.onEnterFrame = function() { if ((filmstrip._x+filmstrip._width) <= yourmovie._width) { delete filmstrip.onEnterFrame; } else { filmstrip._x += 10; } } } For left, it's easier. goright.onPress = function() { filmstrip.onEnterFrame = function() { if (filmstrip._x >= 0) { delete filmstrip.onEnterFrame; } else { filmstrip._x -= 10; } } } Untested, but something like that should do it. :-) Looks to me like you have go left and go right backwards though, don't you? +x ----------> makes it go right -x <---------- makes it go left
|
rocknbil

msg:3607556 | 7:46 pm on Mar 21, 2008 (gmt 0) |
I was right, your buttons are backwards. Here's one that is tested in a movie of 550 px width. Make sure you set the orientation of the symbol filmstrip to 0 and 0, or you'll have to do more complex math. goleft.onPress = function() { filmstrip.onEnterFrame = function() { if (filmstrip._x <= 0) { delete filmstrip.onEnterFrame; } else { filmstrip._x -= 10; } } } goleft.onRelease = function() { delete filmstrip.onEnterFrame; } goright.onPress = function() { filmstrip.onEnterFrame = function() { if ((filmstrip._x+filmstrip._width) >= 550) { delete filmstrip.onEnterFrame; } else { filmstrip._x += 10; } } } goright.onRelease = function() { delete filmstrip.onEnterFrame; }
|
|