Skip to main content
Participant
August 17, 2013
Question

EventListener Failure

  • August 17, 2013
  • 1 reply
  • 586 views

I can't figure out why this button isn't working. I have an air iOS document running actionscript 3.6. When it opens, it runs this code:

var someDate:Date = new Date();

var dayNum:uint = someDate.getMonth();

{

gotoAndStop (dayNum + 3);

          }

(and so on for all the months)

then this

var Aug:Date=new Date(); gotoAndStop(Aug.date, "August")

Once it gets to that frame, I try to run the button

Right.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);

function fl_MouseClickHandler_2(event:MouseEvent😞void { gotoAndStop(currentFrame + 1) }

But nothing happens when I publish and hit the button.
-There's a next frame for it to go to
-I've tried duplicating the button and the action script in a new air document and the button worked
-I tried replacing the "gotoAndStop" in the button with a trace and nothing was retuned.

Really running out of ideas of what could be wrong..... is it the actionscript preceding the eventlistener that's causing it not to respond?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
August 17, 2013

if you put a trace() that's not executing in fl_mch_2 when Right is clicked, you're either not clicking Right or there's an error message (or both).

Participant
August 17, 2013

There's no error message and how could I not be clicking it?

Very confused by this problem

kglad
Community Expert
Community Expert
August 17, 2013

you probably have code in more than one keyframe and/or more than 1 timeline, and whatever you think is Right is probably in more than 1 keyframe or is part of a tween.