Be a Supporter!

Making a menu with multiple buttons

  • 217 Views
  • 4 Replies
New Topic Respond to this Topic
HipnikDragomir
HipnikDragomir
  • Member since: Dec. 2, 2007
  • Offline.
Forum Stats
Member
Level 19
Melancholy
Making a menu with multiple buttons 2013-01-05 15:39:12 Reply

Alright, look: After n00bishly looking around the Internet for guides on how to make a simple play button in AS3, I just barely managed to make one that plays the immediate frames after it with this code:

stop();
play_btn.addEventListener(MouseEvent.CLICK, playMovie);
function playMovie(e:MouseEvent) { play(); }

So, now. How do I make that same frame with the button have multiple buttons each playing separate scenes? Forgive me if this has been asked hundreds of times before, but I have 0 experience with coding and dozens of guides have not helped me with that one play button.


This is my signature. It is a nice signature.

BBS Signature
HipnikDragomir
HipnikDragomir
  • Member since: Dec. 2, 2007
  • Offline.
Forum Stats
Member
Level 19
Melancholy
Response to Making a menu with multiple buttons 2013-01-05 15:43:35 Reply

I have Flash CS5 on the Mac, just btw fyi


This is my signature. It is a nice signature.

BBS Signature
Max-Vador
Max-Vador
  • Member since: Nov. 12, 2005
  • Offline.
Forum Stats
Member
Level 13
Animator
Response to Making a menu with multiple buttons 2013-01-05 17:11:23 Reply

stop();
scn_1btn.addEventListener(MouseEvent.CLICK, playScn1);
function playScn1(e:MouseEvent) {
gotoAndPlay("Scene 2, 1"); 
}
HipnikDragomir
HipnikDragomir
  • Member since: Dec. 2, 2007
  • Offline.
Forum Stats
Member
Level 19
Melancholy
Response to Making a menu with multiple buttons 2013-01-05 17:51:50 Reply

I figured out how to have two buttons in one scene with the stop command on a blank keyframe and yadda yadda.

With this down, do I need to know about scene switching if it'll come in handy for specific things?


This is my signature. It is a nice signature.

BBS Signature
Max-Vador
Max-Vador
  • Member since: Nov. 12, 2005
  • Offline.
Forum Stats
Member
Level 13
Animator
Response to Making a menu with multiple buttons 2013-01-05 18:02:26 Reply

At 1/5/13 05:51 PM, jjjkuk wrote: I figured out how to have two buttons in one scene with the stop command on a blank keyframe and yadda yadda.

With this down, do I need to know about scene switching if it'll come in handy for specific things?

sorry wrote that backwards.

gotoAndPlay(1, "Scene 2");

where 1 is the first frame of scene 2. you have to make a new button called scene2Button or what have you and have the same function of a click listener.

then again if this is the only AS you have in the movie is the buttons then i'd switch to AS 2.0 and just use AS on the buttons themselves and it'll be much easier on you

on(release){
gotoAndPlay(1, "Scene 2");
}