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

Working with buttons

New Here ,
Jun 01, 2014 Jun 01, 2014

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!

TOPICS
ActionScript
100
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
LEGEND ,
Jun 01, 2014 Jun 01, 2014
LATEST

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?

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