To add a new element to an existing array at a specific index : Array Index : Array Flash / Flex / ActionScript examples


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

 

To add a new element to an existing array at a specific index


 


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

        var fruits:Array = ["apples""oranges""pears"];
        
        fruits[3"tangerines";
        
        fruits[39"grapes";
        
        trace(fruits)// Displays: undefined
        trace(fruits[12])// Displays: undefined


    }
  }
}
apples,oranges,pears,tangerines,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,grapes
undefined

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Array
» Array Index