Skip to main content
Atyre77
Participant
November 19, 2018
Answered

1120: Access of undefined property purple1_btn

  • November 19, 2018
  • 1 reply
  • 642 views

Greetings,

I have been trying to find the answer for a while, but they all say the same thing and I have already fixed my instance.

You are supposed to be able to click on the button and go to the next "page" (frame). I DO already have names for my instance. The button name is purple_btn and the instance is purple1_btn.

Here is my code.

stop();

purple1_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_4);

function fl_ClickToGoToAndPlayFromFrame_4(event:MouseEvent):void

{

  gotoAndPlay(21);

}

My friend and I have tried moving things around and changing layers and so on, but nothing has been working, so any help would be greatly appreciated.

Thanks in advance.

This topic has been closed for replies.
Correct answer Atyre77

Can you post your FLA?


I was able to figure it out. Thank you!

1 reply

JoãoCésar17023019
Community Expert
Community Expert
November 19, 2018

Hi.

The code seems correct to me.

Please double check that when you select your button on stage and go to the Properties panel (Ctrl/Cmd + F3) the name field (the first field on top) is really purple1_btn and that the code frame and the button frame are the same (not necessarily the same layer).

Regards,

JC

Atyre77
Atyre77Author
Participant
November 19, 2018

Hello,

I did both of those things already, but checked again and still no change.

Thank you

JoãoCésar17023019
Community Expert
Community Expert
November 19, 2018

Can you post your FLA?