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 
  To: [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