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

Help!! Visibility of a 3rd Button

New Here ,
Apr 10, 2013 Apr 10, 2013

I'm a year12 student creating a major work in which I want to learn the code so that:


Once the user has clicked 2 buttons, a 3rd one will appear (but only once they've both been clicked)

but i'm not sure how to do this because I'm beginning and my teacher doesn't know flash very well
Please help!

TOPICS
ActionScript
611
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

Guru , Apr 15, 2013 Apr 15, 2013

var blue_clicked:Boolean = true;

var pink_clicked:Boolean = true;

var green_clicked:Boolean = true;

blue_btn.visible = pink_btn.visible = true;

green_btn.visible = false;

blue_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);

function fl_MouseClickHandler(event:MouseEvent):void

{

    blue_clicked = true;

    if (blue_clicked && pinked_clicked)

    {

        green_btn.visible = true

    }

}

pink_btn.addEventListener(MouseEvent.CLICK, f2_MouseClickHandler);

function f2_MouseClickHandler(event:MouseEv

...
Translate
LEGEND ,
Apr 10, 2013 Apr 10, 2013

One way would be to have boolean two variables, one for each button, that start out being assigned a value of false and are changed to true when the associated button is clicked.  After that click change is made you test to see if both of those variables are true, and they are then you make the third button appear. 

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
New Here ,
Apr 10, 2013 Apr 10, 2013

I tried that but I wasn't able to do it properly because I don't have enough knowledge of flash and google didn't come up with anything. Would you be able to write out the code to do that for me please? It came up with an error everytime I tried.
Thanks heaps for responding

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 ,
Apr 14, 2013 Apr 14, 2013

Show what you tried.  I'd rather help repair your attempt than write it all out for you.

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
New Here ,
Apr 14, 2013 Apr 14, 2013

This is what I wrote, the pink and blue are the two buttons and green is the button that I want to make visible from them

blue_btn.visible=true;
var blue:Boolean = new Boolean(true);

pink_btn.visible=true;
var pink:Boolean = new Boolean(true);


green_btn.visible=true;
var green:Boolean = new Boolean(true);

blue_btn.visible=false;
pink_btn.visible=false;
green_btn.visible=false;

blue1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);

function fl_MouseClickHandler(event:MouseEvent):void
{
blue_btn.visible=true;
(blue == true)
}

pink1.addEventListener(MouseEvent.CLICK, f2_MouseClickHandler);

function f2_MouseClickHandler(event:MouseEvent):void
{
pink_btn.visible=true;
(pink == true)
}

if(blue == true)
{
return (green == true)
}

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
Guru ,
Apr 15, 2013 Apr 15, 2013

var blue_clicked:Boolean = true;

var pink_clicked:Boolean = true;

var green_clicked:Boolean = true;

blue_btn.visible = pink_btn.visible = true;

green_btn.visible = false;

blue_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);

function fl_MouseClickHandler(event:MouseEvent):void

{

    blue_clicked = true;

    if (blue_clicked && pinked_clicked)

    {

        green_btn.visible = true

    }

}

pink_btn.addEventListener(MouseEvent.CLICK, f2_MouseClickHandler);

function f2_MouseClickHandler(event:MouseEvent):void

{

    pink_clicked = true;

    if (blue_clicked && pinked_clicked)

    {

        green_btn.visible = true

    }

}

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
New Here ,
Apr 15, 2013 Apr 15, 2013
LATEST

Thanks HEAPS!

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