I've heard of actionscript that controls the timeline of a movieclip, but how can you put a AS into a movieclip which controls the Main Timeline?
Regards,
Tongxn
Printable View
I've heard of actionscript that controls the timeline of a movieclip, but how can you put a AS into a movieclip which controls the Main Timeline?
Regards,
Tongxn
movieclip with instance name - aClip
main timeline code -
code on movieclip -Code:aClip.onRollOver = function(){ rev = true; };
aClip.onRollOut = function(){ rev = false; };
Code:onClipEvent(enterFrame){
if(_parent.rev){
_parent.prevFrame();
} else {
_parent.play();
}
}
I don't get that please explain..
open a new fla
make a 50 frame tween on main timeline( ball moving across screen )
add a movieclip to a new layer, give it an instance name - aClip
add a new layer for Actionscript
in frame 1 of Actionscript layer add the main timeline code
(Actionscript editor will show : Actions-Frame )
select your movieclip and add the onClipEvent code
(Actionscript editor will show : Actions-Movie Clip )
Play the movie and mouse over/out of the movieclip, the
main timeline will play forwards or reverse.
This is a simple example of quote -
"AS into a movieclip which controls the Main Timeline"
sorry I didn't explain myself clearly, I mean I didn't get the actionscript you gave..
what part of the ActionScript did you not understand ?
_root.gotoAndPlay("aboutUs");
no matter where this code is, it will be talking to the main timeline (_root.).
Hope this helps,
1M.
Oh that is a much better answer,
Thanks,
Regards,
Yours sinserely,
Tongxn
_root will only work if your swf is the main movie.
If you load this movie into another with movieClip.loadMovie() it will fail.
Recommended to use _parent as the path from movieclip to main timeline.
Oh right
_parent works well for relative paths. If, as the question asks, you want to control the main timeline from anywhere, _root is the absolute (and quickest) path to it.
Good luck,
1M.