Groups | Blog | Home
all groups > flash actionscript > march 2006 >

flash actionscript : controller mc actionscript


vonblonderbelt
3/16/2006 9:07:06 PM
so i have a controller movieclip that rewinds my main timeline. the button
that triggers this mc on and off is present on all the frames except frame 1.
So once I rewind my timeline back to frame 1, the button goes away, but the
controller script continues to rewind, so my scene gets stuck there. What
script should I use to make my movieclip disabled when the root timeline is on
frame 1?
blemmo
3/16/2006 9:16:32 PM
Maybe you should stop the rewind when it reached the first frame. You could use _level0._currentframe to see where the main timeline is from your controller.

hth,
vonblonderbelt
3/17/2006 12:00:00 AM
-Maybe you should stop the rewind when it reached the first frame. You could
use _level0._currentframe to see where the -main timeline is from your
controller.
-
-hth,
-blemmo

Ok, so would I do something like:

if _level0._currentframe = 1 {
_parent.stop();
}

And that would go in the movie clip? Also, what's the difference between
level0 and _parent. For that matter, what's the difference between _parent and
_root? I assume parent is one level up, which might or might not be the main
timeline, and root goes straight to the main timeline. Is that right?
blemmo
3/17/2006 3:20:43 PM
Hi Eirik,

The code to stop the rewind should be in the controller_mc, where the rewind
takes place. How to stop depends on your code, if you used a loop, you should
delete that, or if it's a looping MC, stop the playing.

You're right about _parent, and almost right about _root. _root is the main
timeline of the level where the _root statement sits, so the _root of _level1
would not be the main movie, but the lowest layer in _level1 (identical to
_level1 prefix).
So to make sure you address the main movie, you can always use _level0, that
will lead always to the main movie that started all.

greets,
blemmo
AddThis Social Bookmark Button