Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

controling scene from inside movieclip

Status
Not open for further replies.

bigbird3156

Programmer
Feb 20, 2001
183
AU
Hello...

I have a movie scene (Main) that has a movie clip (MC) plaing in it...

MC has a button that is meant to dictate where in Main to go to; the standard "on release go to and play frame x of Main" does not work, I assume because it is not a seperate scene... can anyone tell me how to control a scene from inside a movie clip? [wiggle]The Bird from Down Under
bigbird_3156@optushome.com.au
 
What's with you Big? Regressing? Thought you were way past that state!
You can't control the playhead on the main movie's timeline from movie clips (and/or from movies loaded on another levels), through the use of scene names. Two ways to do it... A cumulative frame number of all the frames of all the previous scenes (including a preloader if you have one!), that represents the targeted frame, or the "labeled frame method", which is much less prone to errors and much easier to use.
In your case here, since you seem to have but one scene, it's even easier.
Just label the frame you're targeting on the main timeline (your main scene), with an unique label such as my_testtarget1 (how original!), and then on the button script inside your mc, add the following:

on (press){
_root.gotoAndPlay("my_testtarget1");
}

It could be gotoAndStop if you need it to be, but make sure you add _root, which indicates that you're targeting the main timeline, and the label that points to the targeted particular frame.

If this was done from an external .swf loaded on another level, the script would be the same, except that you would replace _root by _level0, as:

on (press){
_level0.gotoAndPlay("my_testtarget1");
} Regards,

new.gif
 
yeh whats up big, regressing?

lol..sheeeeeeeeessssshhhhhh..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Doh.....

Well... um I never said i was a good programmer.. just a programmer.... [cry]

I guess you just miss some things every now and then

thanks for the help and the insults.. lol [wiggle]The Bird from Down Under
bigbird_3156@optushome.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top