Processing Dynamic Instance Variables with for-each-in and for-in Loops : Dynamic object : Class Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Class » Dynamic object »

 

Processing Dynamic Instance Variables with for-each-in and for-in Loops


 

for each (variableOrElementValue in someObject) {
  statements
}


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var info:Object = new Object(  );
        info.city = "Toronto";
        info.country = "Canada";
        
        for each (var detail:* in info) {
          trace(detail);
        }

    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Class
» Dynamic object