Yes, but leave off the "dot" after "this", as Amy shows in the second
line.  I am sure the dot in the first one is just a typo.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Amy
Sent: Friday, May 02, 2008 12:09 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: looping with variable on object

 

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, <[EMAIL PROTECTED]> wrote:
>
> ive tried using the loop as NO Double quotes and using a bracket 
around it too? im not having much luck anyone know a way to do this 
in a for loop NOT foreach.
> 
> 
> ALSO TRIED funfair_tab_challenge[i]
_no.selected=false;
> 
> 
> 
> public function funfair_tab_select(selectwhich){
> 
> if(selectwhich='yes'){
> 
> for(var i:Number = 1; i < 6; i++){
> "funfair_tab_challenge" + i 
+ "_no.selected"=false;
> "funfair_tab_challenge" + i 
+ "_yes.selected"=true;
> }
> 
> }else{
> for(var i:Number = 1; i < 6; i++){
> "funfair_tab_challenge" + i 
+ "_no.selected"=true;
> "funfair_tab_challenge" + i 
+ "_yes.selected"=false;
> }
> 
> }
> 

try

for(var i:Number = 1; i < 6; i++){
this.["funfair_tab_challenge" + i + "_no"].selected=!
(selectwhich='yes');
this["funfair_tab_challenge" + i + "_yes"].selected=
(selectwhich='yes');
}

 

Reply via email to