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

Showing Object but The Other Object is Hidden with button

New Here ,
Jul 19, 2018 Jul 19, 2018

Hi, everyone

I make 3 button for showing different object

Can you show me actionscript 3.0 for showing different object with 3 button

Sorry for bad language

195
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

correct answers 1 Correct answer

Community Expert , Jul 19, 2018 Jul 19, 2018

Hi.

Try this:

import flash.events.MouseEvent;

function showObject0(e:MouseEvent):void

{

     object0.visible = true;

}

function showObject1(e:MouseEvent):void

{

     object1.visible = true;

}

function showObject2(e:MouseEvent):void

{

     object2.visible = true;

}

object0.visible = false;

object1.visible = false;

object2.visible = false;

button0.addEventListener(MouseEvent.CLICK, showObject0);

button1.addEventListener(MouseEvent.CLICK, showObject1);

button2.addEventListener(MouseEvent.CLICK, showObject2);

I hope thi

...
Translate
Jul 19, 2018 Jul 19, 2018

Hi Taufik,

Thanks you for joining this community.

We will gladly helo you, however, need some more info regarding your issue.

Is there any example link which we can refer to and help you further?

Thanks,

Ankush

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
Community Expert ,
Jul 19, 2018 Jul 19, 2018
LATEST

Hi.

Try this:

import flash.events.MouseEvent;

function showObject0(e:MouseEvent):void

{

     object0.visible = true;

}

function showObject1(e:MouseEvent):void

{

     object1.visible = true;

}

function showObject2(e:MouseEvent):void

{

     object2.visible = true;

}

object0.visible = false;

object1.visible = false;

object2.visible = false;

button0.addEventListener(MouseEvent.CLICK, showObject0);

button1.addEventListener(MouseEvent.CLICK, showObject1);

button2.addEventListener(MouseEvent.CLICK, showObject2);

I hope this helps.

Regards,

JC

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