Close, you just need to specify the parent.  Assuming tmp is declared in
instance scope:

this[tmp].selectedIndex = 0;

 

if the compiler complains that selectedIndes is not a property of ....,
do:

TabNavigator(this[tmp]).selectedIndex = 0;

 

Tracy

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Jason B
Sent: Wednesday, September 24, 2008 4:27 PM
To: [email protected]
Subject: [flexcoders] dynamic variable reference getting error 1084

 



var tmp:String = "tabnav1";

[tmp].selectedIndex = 0;

Im trying to use a string to reference an item but the compiler wont
allow the brackets, i remember Tracy telling me to reference a dynamic
variable use brackets? 

my compiler says

error 1084: Syntax error: expecting identifier before dot.

but im sure this is correct 

 

Reply via email to