Skip to main content
CAR AUDIO GUY
Participating Frequently
February 13, 2016
Question

Making a button disappear Permanetely....

  • February 13, 2016
  • 2 replies
  • 574 views

New to Flash...I am making an interactive E Learning Module. I created a menu with 4 buttons. Each button takes you through a different section of the module. What i am trying to accomplish is a notification that you have completed a section by changing the Menu Button to be grey. I created 2 buttons (one in color and one in Black and White). I placed the colored button on top of the Black and white button and then wrote this code. The problem is that even though the code works it resets every time you return to the Menu. How do i make it permanent (until the module is reloaded)

// Amp_Btn1 Click function

function mouseHandler(event:MouseEvent):void

{

  //stop listening for clicks

  Amp_btn1.removeEventListener(MouseEvent.CLICK, mouseHandler);

  //make button invisible

  Amp_btn1.visible = false

}

This topic has been closed for replies.

2 replies

kglad
Adobe Expert
February 13, 2016
var button_inviz:Boolean
if(button_inviz){
Amp_btn1.visible=false;
}

// Amp_Btn1 Click function

function mouseHandler(event:MouseEvent):void

{

  //stop listening for clicks

  Amp_btn1.removeEventListener(MouseEvent.CLICK, mouseHandler);

  //make button invisible

  Amp_btn1.visible = false

button_inviz=true;

}

CAR AUDIO GUY
Participating Frequently
February 13, 2016

Ok, I copied the entire code you sent into frame1, but when i click Amp_btn1 it goes to the assigned frame, but when i return to frame 1 (menu) Amp_btn1  is still there.

CAR AUDIO GUY
Participating Frequently
February 13, 2016

I also tried creating a new project with 1 frame. 1 button on that frame. When i copy the code above into frame 1 and export swf still nothing. When i click Amp_btn1 it does not disappear.

kglad
Adobe Expert
February 13, 2016

use a boolean to determine whether that button should appear and use the boolean to assign the button's visible property at the keyframe where you create your button and when clicking.

CAR AUDIO GUY
Participating Frequently
February 13, 2016

Example? New to Flash...sorry. Not sure how to use boolean

CAR AUDIO GUY
Participating Frequently
February 13, 2016

Let me make sure, This is a movie clip, that I created from a image that i imported. It is not an object i created in Flash