Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now