Be a Supporter!

Actionscript 3 Button to Scene help

  • 421 Views
  • 3 Replies
New Topic Respond to this Topic
TheYnnub
TheYnnub
  • Member since: May. 4, 2008
  • Offline.
Forum Stats
Member
Level 13
Animator
Actionscript 3 Button to Scene help 2011-05-26 17:35:49 Reply

Alright, so this is probably a ridiculously easy question and has probably been answered 100 times over, but I've looked at endless tutorials, including ones that just say "copy this code" and none of it works, so here I go:
I want to make a flash document that will play 20 different scenes. The scenes are independent of one another (will stop when they reach their end rather than continuing to the next, etc.), and are selected for viewing via a navigation bar on the left side (with 20 buttons respective of each scene, obviously).
So, I've tried numerous code to try and make the first frame of each scene recognize all the buttons (they are the same for each scene), and make each button skip to it's respective scene. However, nothing seems to work. Even the "stop();" function ceases to work as soon as I try to enter more code to make the buttons work.
I'm using actionscript 3, which has been proving obnoxiously inconsistent. Any help would be appreciated, guys. Oh, and sorry if this is the wrong forum to ask this question. If it is, let me know, and I'll try and get it moved. Thanks in advance.

TheYnnub
TheYnnub
  • Member since: May. 4, 2008
  • Offline.
Forum Stats
Member
Level 13
Animator
Response to Actionscript 3 Button to Scene help 2011-05-27 02:39:54 Reply

Made some headway. It appears my problem involves the way I assign functions to buttons, as it give me a duplicate function return error. My framecode looks somehting like this:

button01.addEventListener(MouseEvent.MOU SE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
gotoAndStop(1, "Scene 01");
}

button10.addEventListener(MouseEvent.MOU SE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
gotoAndStop(1, "Scene 10");
}
stop();

Any ideas what's causing that?

HowardWimshurst
HowardWimshurst
  • Member since: Apr. 20, 2011
  • Offline.
Forum Stats
Supporter
Level 05
Animator
Response to Actionscript 3 Button to Scene help 2011-05-29 13:38:30 Reply

I have the same problem

mohawkade
mohawkade
  • Member since: Feb. 20, 2009
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Actionscript 3 Button to Scene help 2011-05-31 23:52:27 Reply

I just end up switching to Actionscript 2 for buttons, links, and other interactivity. However I am a fan of the Bone tool, which can exclusively be used in Actionscript 3.


BBS Signature