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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get out from a MC using a button insite MC

Status
Not open for further replies.

Radasca

Technical User
Mar 24, 2004
2
RO
I have a swf with 4 scenes (just for test). in scene 1 is a circle, in scene 2 are 2 circles, in scene 3 are 3 circles and in scene 4 are 4 circles and one MC. In this MC I have a button. What is the action script that I have to put on this button in order to go in scene 4 frame 2 (for example).
I tryed telltarget:
"
on (release) {
tellTarget ("_root") {
gotoAndPlay ("Scene 4", 1);
}
}

and
on (release) {
tellTarget ("_root") {
gotoAndPlay (1);
}
}

"

and other many variants but always this action send me to scene 1 frame 1.

I want scene 4 frame x, not scene 1 frame 1
 
Well you could use dot syntax rather than tellTarget which is deprecated, although it still does work.

Problem is you can't target main timeline scene names from movie clips or from external movies loaded on other levels.
You must either target frame numbers or much better, labeled frames. Thus label the targeted frame in the targeted scene with an uinique label such as my_scene42 (or whatever suits you - but no number only labels, or at least not starting off with a number, and no other special character other than the underscore), add _root (from movie clips) or _level0 (from loaded movies on other levels) to your path, and target the labeled frame...

on(release){
_root.gotoAndPlay("my_scene42");
}

Or possibly...

on (release) {
tellTarget ("_root") {
gotoAndPlay("my_scene42");
}
}


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top