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

Pop out buttons will not work inside movie ! why?

Status
Not open for further replies.

hoja

Technical User
Dec 3, 2003
102
US
hi, I created a main_scene movie....then I created a movie clip with pop out buttons and I inserted this movie clip (buttons) into my main_scene but for some reason when I tell my buttons that on release gotoAndPlay this scene, it will not work...anyone know why?
 
Most probably because you're targeting scene names, and that you can't target scene names from movie clips or from loaded external movies on other levels... In fact you should never target scene names, even from the main timeline, where it does work if everything is ON the main timeline.
Target a labeled frame instead...

Thus 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 spaces and no special characters other than the underscore...), add _root or _level0 to target the main timeline to your path, and target the labeled frame in your button's or frame's scripts...
Code:
on(release){
    _level0.gotoAndPlay("[b]my_target1[/b]");
}
 
OLDNEWBIE, thank you very much for your replies, they have really heped me, and thanks to everyone who posts on here.

rod
 
ok, this works fine..and thanks for the tip, but I am having another problem now...everytime I click the "home" button that is linked to "frame_1" Label, it goes to frame 1 and if I click it again it goes to frame 2 and then back to frame 1 if I click it again and so forth...why is this happening to me? please help.

the code that I have on my "Home" button is the following;

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

 
How about a gotoAndStop() rather than a gotoAndPlay() ?

on (release) {
_root.gotoAndStop("frame_1");
}

In any case, you should code a second press on a button (of a page already displayed), to do nothing...
 
offcourse!!! It's kind of late for me I think !!! I had tried almost everything....spent a couple hours researching and trying different pieces of code including if then else statements to try to stop this from happening...thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top