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

problem with scenes 1

Status
Not open for further replies.

technoknow

Technical User
Apr 19, 2002
121
US
I have 3 scenes. There are 2 navigation buttons that are in all 3 scenes. Scene 2 and scene 3 have movie clips that I'm trying to play using:
home.onRelease = function() {
gotoAndPlay("Scene 2",1);
};
about.onRelease = function() {
gotoAndPlay("Scene 3",1);
};
This works fine except when trying to play the scene that you're in. For instance if you are in Scene 2 and hit the "Home" button to play scene 2 it goes to the next scene instead.
I can jump from scene 1 to 3 or from Scene 3 to 2 but why can't I jump from scene 2 to 2? Should I just replay the scene I'm in using a different command?
Hope this is clear enough for you guys to understand, I've been reading posts on the subject of scenes and know that they are a pain. I'd like to figure out why this doesn't work but if there is an easier way to do what I'm trying to do without using scenes I'd sure like to hear it.
Maybe I should make scene 1 a mc and have the other mc's play inside of it.
Thanks for your help, you guys are great!
TechNoKnow
 
Scenes are sometimes buggy in flash... generally I don't use them and I have read it suggested in many forums not to, but instead uss the loadMovie function. But, if you must use them, try targeting a label in the scene instead of a frame, should solver your problem

K
 
Think targeting scene names to start with is the problem... But too much confusion in your explanation...
Can you post a link to your .fla or a mockup, recreating the situation? Zipped up and in MX only format.
 
Don't quite understand what you're getting at here, but I think you problem would be solved if you simply used gotoAndStop rather than gotoAndPlay, everywhere in all scenes...

home.onRelease = function() {
gotoAndStop("Scene 2",1);
};
about.onRelease = function() {
gotoAndStop("Scene 3",1);
};

Now targeting scene names works because this is on the main timeline, but probably wouldn't if the call swere done from a movie clip or from a loaded movie on other level. You would then have to target labeled frames rather than scene names.
 
adam14,
thanks but it doesn't work at all now. I've tried to add the frame labels and change to gotoAndStop("homeclick") but now the buttons don't respond at all now.

oldnewbie,
I changed everything to gotoAndStop("Scene 2",1) and the buttons work but it doesn't do anything if you're already in Scene 2, is there just a "refresh" command.
Thnks,
techNoKnow
 
The file I sent you worked, no? All I did was label frame 1 in each scene, and then changed the goto's to Stops with the frame labels...this isn't working for you?
 
No, it didn't do anything. I opened up the mockup2.fla and then then control, test movie and the buttons didn't do anything at all.
 
That is wierd! It looks like it works fine, except if you click on home again it doesn't reload. Is there a reason for that?
Thanks
 
Adam,
Thanks! So you named the mc "arrow" and then; _root.arrow.gotoAndPlay(1);
replays it. It works great!
Your perseverance is well worth a star!
TechNoKnow
 
hey thanks...and you're welcome! Glad it worked this time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top