# Please help with this script

**URL:** https://forum.kirupa.com/t/please-help-with-this-script/265785
**Category:** Uncategorized
**Created:** [July 12, 2008, 1:00pm UTC](https://forum.kirupa.com/t/please-help-with-this-script/265785 "2008-07-12T13:00:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vohyndra](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vohyndra](https://forum.kirupa.com/u/vohyndra)
#### Post date: [July 12, 2008, 1:00pm UTC](https://forum.kirupa.com/t/please-help-with-this-script/265785/1 "2008-07-12T13:00:04Z")

</div>

hello there im new in flash andi wounder if any one can help me  
im recibing from a php page 250 variables and i have 250 buttons on my flash  
im recibing the variables like his &depto1=Cerrado&depto2=Apartado&depto3=Disponible&depto4=Cerrado&depto5=Cerrado…&depto250=Cerrado  
if i make a trace im recibing all 20 varaiables.

what i whant to do is that if the variables = Cerrado the button would be disable, if the variable = Apartado the button will be alpha 30; and if the varaible = Disponible, Nothig happens.  
i dont whant to write 250 times this

[COLOR=red]if (depto1 == “Cerrado”) {[/COLOR]  
[COLOR=red]BTNdepto1.enabled = false;[/COLOR]  
[COLOR=red]BTNdepto1.\_alpha = 0;[/COLOR]  
[COLOR=red]} else if (depto1 == “Apartado”) {[/COLOR]  
[COLOR=red]BTNdepto1.enabled = false;[/COLOR]  
[COLOR=red]BTNdepto1.\_alpha = 30;[/COLOR]  
[COLOR=red]}[/COLOR]

so im using this but its not working

[COLOR=red]for (var i:Number = 1; i \<= 250; i++){[/COLOR]  
[COLOR=red]if (BTNdepto + i == “Cerrado”){[/COLOR]  
[COLOR=red](BTNdepto + i).enabled = false;[/COLOR]  
[COLOR=red](BTNdepto + i).\_alpha = 0;[/COLOR]  
[COLOR=red]} else if (BTNdepto + i == “Apartado”){[/COLOR]  
[COLOR=red](BTNdepto + i).enabled = false;[/COLOR]  
[COLOR=red](BTNdepto + i).\_alpha = 50;[/COLOR]  
[COLOR=red]}[/COLOR]  
[COLOR=red]}[/COLOR]  
could any one help me please …  
thanks…

i am using actionscript 2 in flashcs3… thanks

---

<div class="post-metadata">

### Author: ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)
#### Post date: [July 12, 2008, 1:31pm UTC](https://forum.kirupa.com/t/please-help-with-this-script/265785/2 "2008-07-12T13:31:27Z")

</div>

this[“BTNdepto” + i].enabled = false;

etc…
