Iterate through the key-value pairs of an object with the for..in and for each..in loops. : Dictionary : Array Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Array » Dictionary »

 

Iterate through the key-value pairs of an object with the for..in and for each..in loops.


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var notes:Object = {t: 2, g: 14, s: 9};
        for (var name:String in notes)
        {
            trace("Notes on " + name + ": " + notes[name]);
        }

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Array
» Dictionary