|
-
XRave
Timeline Ctrl Urgent HELP!
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
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
FK'n_dog
movieclip with instance name - aClip
main timeline code -
Code:
aClip.onRollOver = function(){ rev = true; };
aClip.onRollOut = function(){ rev = false; };
code on movieclip -
Code:
onClipEvent(enterFrame){
if(_parent.rev){
_parent.prevFrame();
} else {
_parent.play();
}
}
-
XRave
I don't get that please explain..
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
FK'n_dog
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"
-
XRave
sorry I didn't explain myself clearly, I mean I didn't get the actionscript you gave..
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
FK'n_dog
what part of the ActionScript did you not understand ?
-
target _root.
_root.gotoAndPlay("aboutUs");
no matter where this code is, it will be talking to the main timeline (_root.).
Hope this helps,
1M.
-
XRave
Oh that is a much better answer,
Thanks,
Regards,
Yours sinserely,
Tongxn
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
FK'n_dog
_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.
-
XRave
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
indeed
_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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|