Skip to main content
April 25, 2011
Answered

Incredibly simple question

  • April 25, 2011
  • 1 reply
  • 463 views

I've been at this for a little over 35 minutes and, quite frankly, it's embarrassing.  I've just upgraded from CS3 to CS5 and I can't seem to make the simpliest button work.

I've got a box that I converted to a button called reset_btn.  It's located on stage and on frame one.  I added a layer and F9'd it with the following code:

reset_btn.addEventListener(MouseEvent.CLICK, fireAway);

function fireAway(event:MouseEvent):void {
    trace("Can you hear me now?");
}

It keeps kicking it off and giving me this error:

Scene 1, Layer 'as3', Frame 1, Line 1    1120: Access of undefined property reset_btn.

I can see reset_btn just as clear as day in the library and I've quadrupal checked the spelling.  What am I missing?!

This topic has been closed for replies.
Correct answer Ned Murphy

Are you referring to the name it has in the library or the instance name that you need to assign it on the stage?

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
April 25, 2011

Are you referring to the name it has in the library or the instance name that you need to assign it on the stage?

April 25, 2011

LOL

That was it.  Mondays can be sooo painful.

Many thanks for that

Ned Murphy
Legend
April 25, 2011

You're welcome