Brian
Brian

Reputation: 3

Actionscript 3 button is using previous code

I have one button for this slider. The slider has three sections.

Frame 24 has the first frame loaded. It is labeled "frame1". There is a button with the following code. rightButton_1.addEventListener(MouseEvent.CLICK, bj_goRightTo2);

function bj_goRightTo2(event:MouseEvent):void
{
gotoAndPlay('1goesTo2');
}

Frame 25 starts the transition between the first and second frame. It is labeled "1goesTo2".

Frame 64 is the second frame loaded. It is labeled "frame2" Again there is a button with the next set with a gotoAndPlay('2goesTo3')

Frame 104 is the third frame loaded. It is labeled "frame3" Again there is a button with gotoAndPlay('3goesTo1').

But at the end of 3goesTo1 is a gotoAndStop('frame1').

At 'frame1' the code tells the button to gotoAndPlay('1goesTo2') but it actually only does the last gotoAndPlay('3goesTo1');

How can I get this button to refresh it's code?

Upvotes: 0

Views: 343

Answers (1)

Larusso
Larusso

Reputation: 1151

I would`t try to change the eventhandler in the timeline. Instead I would add one eventhandler in the parent clip and check the current label when the button receives a mouse click event.

Upvotes: 0

Related Questions