Use variable as the array index : Array Index : Array Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Array » Array Index »

 

Use variable as the array index


 


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

        var cities:Array = ["Toronto""Montreal""Vancouver""Waterloo"];
        
        var i:int 1;
        cities[i"Beijing";
        
        
        trace(cities)//Toronto,Beijing,Vancouver,Waterloo
        
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Array
» Array Index