Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

EventListener Failure

New Here ,
Aug 16, 2013 Aug 16, 2013

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?

TOPICS
ActionScript
559
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2013 Aug 16, 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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 16, 2013 Aug 16, 2013

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

Very confused by this problem

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2013 Aug 17, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines