Skip to main content
Participant
June 1, 2014
Question

Working with buttons

  • June 1, 2014
  • 1 reply
  • 118 views

Hello!

import flash.text.TextFormat;

btn2.visible = false;

btn.addEventListener(MouseEvent.CLICK, myClickReaction);

function myClickReaction (e:MouseEvent):void{

trace("I was clicked! myclickreaction");

tekst.text = "This is my text";

btn.visible = false;

btn2.visible = true;

}

btn2.addEventListener(MouseEvent.CLICK, myClickReaction2);

function myClickReaction2 (e:MouseEvent):void{

trace("I was clicked!myclickreaction2");

tekst.text = "This is my text2";

btn.visible = true;

btn2.visible = false;

}

This is my code. I have 2 buttons on screen. After clicking btn, btn2 do not show himself. Why?

Thank you!

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
June 1, 2014

There is nothing wrong with the code... it works if I test it.  Do you see the trace from the line : trace("I was clicked! myclickreaction"); ?  Do you get any error messages?