# Enabling button AFTER Click

**URL:** <https://forum.kirupa.com/t/enabling-button-after-click/182271>\
**Category:** flash\
**Created:** [March 16, 2006, 7:47pm UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271 "2006-03-16T19:47:58Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dunger99us](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@dunger99us](https://forum.kirupa.com/u/dunger99us)\
**Post date:** [March 16, 2006, 7:47pm UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/1 "2006-03-16T19:47:58Z")

</div>

Hello,  
here is what i am trying to accomplish:

1. i have set of buttons which user have to click before the final button appears.
2. each button after click will navigate to a certain frame with correct answer is being displayed.
3. once there user can click back to navigate back to the initial page to continue clicking remaining buttons.

once all have ben clicked the final button appears allowing further navigation.

the situation is as follows:

flash counts if a ALL buttons have been clicked and only after that it shows the final one which upon clicking will navigate to another frame.

Help???Please:)

---

<div class="post-metadata">

**Author:** ![dunger99us](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@dunger99us](https://forum.kirupa.com/u/dunger99us)\
**Post date:** [March 20, 2006, 1:16pm UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/2 "2006-03-20T13:16:38Z")

</div>

thank you very much… I have just arrived, let me try. i appreciate your support and help.

---

<div class="post-metadata">

**Author:** ![Elementss](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elementss/32/1698_2.png) [@Elementss](https://forum.kirupa.com/u/Elementss)\
**Post date:** [March 20, 2006, 1:53pm UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/3 "2006-03-20T13:53:47Z")

</div>

i liked the Super Button 😛 in the file.sw  
amm… the file is not Opening in my PC…😑  
if you could just answer me this few Quastions ill be very Glad 🙂

this is how i define the “Flags”? no other Actions ?

```auto
buttons_state = [0,0,0,0,0];

```

this is on the frame ActionScript ofcourse… yes?  
how do i link those Flags to a buton ?

```auto

on(press/rollOver/release/etc'..:)){
 
    //what code do i put here ?
 
     buttons_state = [1,0,0,0,0];
 
    // just other Flag state? or at a different way?
    //(im sure that its in a diferent way :))
}

```

```auto

 
n=[COLOR=#000080]0[/COLOR];
[COLOR=#0000ff]for[/COLOR] [COLOR=#000000]([/COLOR]i=[COLOR=#000080]0[/COLOR];i<[COLOR=#000080]5[/COLOR];i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR]A[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR]==[COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
n++;
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR]n==[COLOR=#000080]5[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]gotoAndPlay[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"special_frame"[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
 

```

n - what does ‘n’ refers to ?

(would it be more easyer if the file would have opend in my PC =) )

thanks in Advanced:thumb2:  
Stas

---

<div class="post-metadata">

**Author:** ![goto](https://avatars.discourse-cdn.com/v4/letter/g/b4bc9f/32.png) [@goto](https://forum.kirupa.com/u/goto)\
**Post date:** [March 20, 2006, 5:47pm UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/4 "2006-03-20T17:47:08Z")

</div>

Check if you can open the file now

---

<div class="post-metadata">

**Author:** ![Elementss](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elementss/32/1698_2.png) [@Elementss](https://forum.kirupa.com/u/Elementss)\
**Post date:** [March 20, 2006, 7:55pm UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/5 "2006-03-20T19:55:58Z")

</div>

no ☹

a message pops up telling me : unexpected file format:jailbreak

---

<div class="post-metadata">

**Author:** ![goto](https://avatars.discourse-cdn.com/v4/letter/g/b4bc9f/32.png) [@goto](https://forum.kirupa.com/u/goto)\
**Post date:** [March 20, 2006, 11:39pm UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/6 "2006-03-20T23:39:04Z")

</div>

But, I saved it as Flash MX, are you using flash 5?, because I dont have flash 5 file format avalaible. Please tell me what flash version are you using.

---

<div class="post-metadata">

**Author:** ![Elementss](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elementss/32/1698_2.png) [@Elementss](https://forum.kirupa.com/u/Elementss)\
**Post date:** [March 21, 2006, 11:07am UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/7 "2006-03-21T11:07:58Z")

</div>

i am using “Macromedia Flash MX 2004” :cyclops:

---

<div class="post-metadata">

**Author:** ![Elementss](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elementss/32/1698_2.png) [@Elementss](https://forum.kirupa.com/u/Elementss)\
**Post date:** [March 21, 2006, 10:17pm UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/8 "2006-03-21T22:17:33Z")

</div>

i have been doing some reading…  
so now im stuck at the “if…” statement

ive defined the Array:

```auto
      firstArray = [0,0,0];

```

then ive changed the value of each “Flag” in the array by a button :

```auto
              on(press){
	              firstArray[0] = 1 ;
              }

```

did that to all of them (firstArray[0] , firstArray[1] , firstArray2]).

now i want to make the if statement like this :  
If they all 1 =\> jump to “Special\_Frame”

so it should look something like this:

```auto
if(firstArray[0]==1){
	if(firstArray[1]==1){
		if(firstArray[2]==1){
			gotoAndStop(Special_Frame);
		}
	}
}

```

is this corect? i mean…isn’t there an easyer way?

[U]P.S.[/U]  
i could not Open your file in the end…but your messages helped me allot. ty 🙂

---

<div class="post-metadata">

**Author:** ![goto](https://avatars.discourse-cdn.com/v4/letter/g/b4bc9f/32.png) [@goto](https://forum.kirupa.com/u/goto)\
**Post date:** [March 21, 2006, 10:48pm UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/9 "2006-03-21T22:48:07Z")

</div>

There is an easier way  
ActionScript Code:  
[FONT=Courier New][LEFT]n=[COLOR=#000080]0[/COLOR];  
[COLOR=#0000FF]for[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
n++;  
[COLOR=#000000]}[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[COLOR=#0000FF]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]gotoAndPlay[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

this simple code just initialize a counter var (n) in 0 and make a count of the array members containing 1. So, you compare, if n==the number of elements of the array, it means that all your array memebers have been switched to 1, and its ready to go to special frame. else, it wont do nothing and will review again the next time it pass by this coded frame.

Here is again the file, I have saved it even as MX, it must work now 😛

---

<div class="post-metadata">

**Author:** ![Elementss](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elementss/32/1698_2.png) [@Elementss](https://forum.kirupa.com/u/Elementss)\
**Post date:** [March 24, 2006, 6:04am UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/10 "2006-03-24T06:04:12Z")

</div>

this code is good for an array that has many elements i sopose…🙂  
i have only 4…  
ok …  
it all works fine now 🙂  
Thank you for your help 🙂

Stas

---

<div class="post-metadata">

**Author:** ![bhaskar](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@bhaskar](https://forum.kirupa.com/u/bhaskar)\
**Post date:** [March 24, 2006, 6:19am UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/11 "2006-03-24T06:19:38Z")

</div>

**Hi**  
**This is Bhaskar i have doubt in flash action script my qustion is below**  
**i take one text box and 2 buttons when i will type in text then click on one button text will displayed on another button.**  
\*\*if it possible plz help me \*\*  
**thanking u**

---

<div class="post-metadata">

**Author:** ![goto](https://avatars.discourse-cdn.com/v4/letter/g/b4bc9f/32.png) [@goto](https://forum.kirupa.com/u/goto)\
**Post date:** [March 24, 2006, 11:08pm UTC](https://forum.kirupa.com/t/enabling-button-after-click/182271/12 "2006-03-24T23:08:39Z")

</div>

of course its possible, but I have to go now, Im back tonight 😉
