Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

External vars

Status
Not open for further replies.

keish

Technical User
Joined
Apr 1, 2007
Messages
7
Location
PT
Hello all

I'm loading external vars from a txt file into texboxs. I also have movieclips that might be visible or invisible.


The problem is that I want to be able to have cases when some especific vars are loaded, a case in wich nothing is loaded and another case for everything else.

What I have right now is this:


(etc, etc...)

switch (this.test) {
case "ABC 123" :
_root.A_mc._visible = true
break;

case "ABC 456" :
_root.A_mc._visible = true
break;

case "ABC 789" :
_root.A_mc._visible = true
break;

case "DEF 123" :
_root.B_mc._visible = true
break;

case "DEF 456" :
_root.B_mc._visible = true
break;

case "DEF 789" :
_root.B_mc._visible = true
break;

CASE "" :
_root.A_mc._visible = false
_root.B_mc._visible = false
break;

DEFAULT :
_root.C_mc._visible = true


The ' case "" ' doesn't work. I'm not sure if it's possible to return the null value.

I also would like to know if I can group the variables that starts with the same letters, like ABC... and DEF... like case "ABC"+ (something...)


Thx in advance
Keish
 
if (this.test.substring(0, 3) == "ABC") {
_root.A_mc._visible = true;
} else if (this.test.substring(0, 3) == "DEF") {
_root.B_mc._visible = true;
} else {
_root.A_mc._visible = false;
_root.B_mc._visible = false;
}
_root.C_mc._visible = true;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top