BTW, assuming that initApp() is a method of your <mx:Application>, the
'this' object for initApp() is the instance of your application.
Therefore you can just refer to parameters[i] rather than to
Application.application.parameters[i].
 
- Gordon

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Lex
Sent: Friday, November 30, 2007 10:42 AM
To: [email protected]
Subject: Re: [flexcoders] Arrays, iteration, and referencing local
variables?



Got it with:
 
private function initApp():void{

var elements:Array = [ 

"scrmurl", "form_title", "form_email", "form_subject",

"form_message", "form_submit", "category", "confirmText", 

"wait", "success_title", "success" 

];

for( var i:String in elements ){ 

if( Application.application.parameters[i] ) 

this[i] = Application.application.parameters[i];

} 

}

 

 

        ----- Original Message ----- 
        From: flexnubslice <mailto:[EMAIL PROTECTED]>  
        To: [email protected]
<mailto:[email protected]>  
        Sent: Friday, November 30, 2007 3:36 AM
        Subject: [flexcoders] Arrays, iteration, and referencing local
variables?


        I'm trying to do something like this, but am unsure of the
proper
        language constructs in Flex:
        
        var a:String = "";
        var b:String = "";
        var c:String = "";
        
        private function initApp():void{
        var elements:Array = [ "a", "b", "c" ];
        
        for( var i:String in elements ){
        if( Application.application.parameters.i )
        this.i = Application.application.parameters.i;
        }
        }
        
        Just trying to init some vars if they were set, but not sure how
to
        reference the this.i part..
        
        Thanks!
        Alex
        
        

 

Reply via email to