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

gotoAndPlay() not responding and changing scene

Status
Not open for further replies.

clemrock

Programmer
May 20, 2004
118
US
Hello,

I have a button that has a simple gotoAndPlay method that works perfectly.

Code here:

on (release)
{
gotoAndPlay("Intro", 1);
}

I want to have a button that has a dynamic label that changes according to a variable so I made a new button in the form of a movie clip. When I try to activate the same code in the movie clip's onRelease method it doesn't respond.

Here's the code in the movie clip:

on (release)
{
_root.gotoAndPlay( "_root.Intro", 1);
}

on( rollOver )
{
gotoAndStop("over");
}

on( rollOut )
{
gotoAndStop("down");
}

I've tried every possibility I can think of such as

_parent.gotoAndPlay( "_root.Intro", 1);

Any ideers?

Clem C

 
Since targeting scene names only really works when everything is on the main timeline (not from movie clips nor from loaded movies on other levels), you should forget ever targeting scene names altogether, even from the main timeline.
Label the targeted frame in the targeted scene, with an unique label such as my_target1 (no number only labels or at least not starting off with a number, no caps & no special characters other than the underscore...), add the targeted timeline to your path, and target that labeled frame in your button's, mc's or frame's actionscript...
Code:
on(release){
    _root.gotoAndPlay("[b]my_target1[/b]");
}

Works as a charm from anywhere!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top