Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Switching between scenes using buttons...not working?

Posted on 2003-12-10
6
Medium Priority
?
358 Views
Last Modified: 2010-04-03
I have divided the content of the six sections of my movie into six scenes.  They all share the same basic layout including the navigation bar I would like used to switch between areas or scenes.  The common elements of that layout are grouped together as a symbol, and separate instances of that symbol appear in each of the six sections.

I am trying to get the buttons to navigate between scenes.  I've followed the instructions in the help file and as I've seen on this site.  I edit the symbol that contains the buttons, and set each button so it has a variation of this attached:

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

where Home is whatever the name of the scene is.  I have also tried this using _root.gotoAndPlay.  As well, I've tried elevating the buttons from inside the common layout element symbol so they're their own instances within the scene.

When I test the movie, the buttons don't appear to work.  But here's the bizzarre thing--immediately after opening the document or reverting it, if i then double click on the symbol instance to edit it, then turn on simple buttons, then click one of the buttons, it works.  But only once, then it quits working again.  Somehow after that happens all the actionscript assigned to the buttons just dissappears.

I am totally baffled, and I'm hoping someone out there has encountered this before.  Thanks in advance for the help.
0
Comment
Question by:hayeahright21
6 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 9911710
Hi there.
Assuming you're using MX,
your code is right, so I can only assume it's something really minor that you've overlooked.

You're duplicating  your grouped navigation in each scene, I can only suggest you check carefully
1. Names of each scene - remember they are case sensitive, use your scene inspector.
2. Check the code on your buttons that they are right for each scene
3. Do you get any errors in the output window when running your movie.
0
 
LVL 9

Accepted Solution

by:
rexmor earned 2000 total points
ID: 9925855
hayeahright21,

Hmmnn may your button is inside a movieClip... if that's the case then please try this..

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

hope that helps.


rexmor
0
 
LVL 9

Expert Comment

by:rexmor
ID: 9925862
on (release){
tellTarget(_root){
gotoAndPlay("target_scene");
}
}


rexmor
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:hayeahright21
ID: 9928368
There's one very important trick I've learned when trying to speak a foreign language: if you don't know the exact word for something, talk around it.  That's basically my solution to this problem: instead of having the button contain the command to go to a specific scene, it had this little bit attached to it:

on (press) {
    _root.DJButton.onRelease = function() {
        gotoAndPlay(3);
    };
}

Where "3" is a frame in the root movie and the same scene that contains the action telling the thing to go to the scene the button is intended to take you to.  So basically I did two steps to do one thing, but it worked.  Looking at rexmor's answer, though, I think that if I'd been patient enough to wait for it, it would have worked.  Seems like the prob relates to the button being embedded in a movie clip.

Thanks all for the help.

-= jonathan =-
0
 

Expert Comment

by:MasterStanF2k
ID: 10292712
question. Building on this... I have a preloader and basically 2 frames in SCENE 1 (root). I have 1 frame with preloader, and frame 2 has the main movie. The 2 frame has "scene 2" and in this scene, I need to be able to link to "Clan Info" which is the instance name of some frames. Anyways, instead of _root, what do I do??
0
 

Expert Comment

by:MasterStanF2k
ID: 10292942
I got
"
on (release) {
tellTarget("_level1.Symbol 2"){
gotoAndPlay("ClanInfo");
}
}
"
But that doesn't work :(
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question