Creating a Separate Copy of an variable : Value Reference : Data Type Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Data Type » Value Reference »

 

Creating a Separate Copy of an variable


 


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

        var quantity:int 5;
        
        var newQuantity:int = quantity;
        
        quantity = 29;
             
        trace(quantity);        // Displays: 29
        trace(newQuantity);     // Displays: 5

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Data Type
» Value Reference