Be a Supporter!

Menus problems with Actionscript

  • 220 Views
  • 3 Replies
New Topic Respond to this Topic
MOC-Productions
MOC-Productions
  • Member since: Mar. 27, 2003
  • Offline.
Forum Stats
Member
Level 15
Filmmaker
Menus problems with Actionscript 2010-10-14 01:51:54 Reply

Okay, so every time I have to make a menu for my flashes, I struggle. I run into the same problem every time. I usually manage to figure it out, but it's been so long, I can't remember.

I'm using Flash 8 (which I guess is ancient now, but I prefer it) and all I want to do is make some simple buttons that go to certain scenes.

For instance, lets say I have 3 scenes, simply called "Scene 1" "scene 2", and "scene 3". I'll make a button for scene 1, test it, it works fine. I check for errors and AS tells me there are none. I don't know how to write it out exactly like in AS here, but its something like:

onrelease
gotoandplay ("scene 1") ;
}

or something like that. I know I'm putting it in correctly, bottom line.

Well here's where the problems start. I'll make the same exact kind of button, only for scene 2. and it will look something like this:

onrelease
gotoandplay ("scene 2") ;
}

Should be simple enough, right? No. Again, I check for errors...none. But when I click the button, it just goes to scene 1. So I try making another button and I do the same thing for scene 3. Well surprise, surprise, it just plays scene 1.

Can someone please explain to me why no matter what scene I tell my buttons to play, they just play scene 1???

Fion
Fion
  • Member since: Aug. 21, 2005
  • Offline.
Forum Stats
Member
Level 39
Blank Slate
Response to Menus problems with Actionscript 2010-10-14 02:15:32 Reply

if you use gotoAndPlay("scene 2"); it will go to the frame with the label scene 2. To go to the scene named scene 2 you need to specify a frame number, so to go to the start of scene 2: gotoAndPlay("scene 2", 1);

Also it's case sensative so work out whether you are using Scene 2 or scene 2, it makes a difference.


.

BBS Signature
MOC-Productions
MOC-Productions
  • Member since: Mar. 27, 2003
  • Offline.
Forum Stats
Member
Level 15
Filmmaker
Response to Menus problems with Actionscript 2010-10-14 20:36:00 Reply

At 10/14/10 02:15 AM, Fion wrote: if you use gotoAndPlay("scene 2"); it will go to the frame with the label scene 2. To go to the scene named scene 2 you need to specify a frame number, so to go to the start of scene 2: gotoAndPlay("scene 2", 1);

Tried that, still have the same problem. As for it being case sensitive, I type it exactly the same.

MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to Menus problems with Actionscript 2010-10-16 10:57:56 Reply

I would just try giving the frame a label and just going to that. I've always found Scene switching kinda weird to work with otherwise.

Here's a start: http://www.brainbell.com/tutorials/Flash /Add_Frame_Labels_For_Navigation.htm


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature