Solved

Switching between scenes using buttons...not working?

Posted on 2003-12-10
6
349 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
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
on (release){
tellTarget(_root){
gotoAndPlay("target_scene");
}
}


rexmor
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:hayeahright21
Comment Utility
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
Comment Utility
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
Comment Utility
I got
"
on (release) {
tellTarget("_level1.Symbol 2"){
gotoAndPlay("ClanInfo");
}
}
"
But that doesn't work :(
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now