noland
noland

Reputation: 125

Two out of Three MovieClip buttons work in a Frame Actions using ActionScript 3.0

So here's the issue:

I have created 3 button symbols and they are each in their own 3 movieclip symbols with their own instance names.

In an actionframe on Frame 1, I have the following code:

stop();

codebutton.addEventListener(MouseEvent.MOUSE_UP, onReleaseCode);
titlebutton.addEventListener(MouseEvent.MOUSE_UP, onReleaseTitle);
audiencebutton.addEventListener(MouseEvent.MOUSE_UP, onReleaseAudience);

function onReleaseCode(e:MouseEvent):void {
 nextFrame();
}

function onReleaseTitle(e:MouseEvent):void {
 this.gotoAndPlay(187)
}

function onReleaseAudience(e:MouseEvent):void {
 this.gotoAndPlay(416)
}

Like I said, 2 of them work: the audiencebutton and codebutton. titlebutton does not.

I'm not really experienced in ActionScript 3.0, if anyone can give some input that would be great.

It couldn't be bugging because I don't use labels, does it?

Upvotes: 0

Views: 89

Answers (1)

Joetjah
Joetjah

Reputation: 6132

Well, since I've been doing this kind of stuff in the past weeks, I can at least list up what needs to be checked, in case something went wrong there. Ofcourse it would be more efficient if you posted some code or told us what 'doesn't work'. Or rather, what still does work.

Anyway, make sure that:

  1. Your buttons are declared correctly. Does titlebutton link to a class, which is the document class of a sprite? Make sure by editing the class of the sprite to see if you actually end up in the correct class.

  2. Doublecheck that the position 187 exists on the timeline of your animation/sprite/tween. Sometimes, I tend to actually delete some positions by deleting empty Symbols.

  3. Your function actually gets called. Throw in trace-functions everywhere. It looks cool and if you show it to someone, it actually looks like the Matrix and stuff. Plus it helps you keeping track of stuff that goes on in your application.

Upvotes: 1

Related Questions