Dynamic References to Variables and Methods : Dynamic object : Class Flash / Flex / ActionScript examples


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

 

Dynamic References to Variables and Methods


 

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

        var info:Object = new Object(  );
        info["city""Toronto";
        info["country""Canada";
        var detail:String = "city";
        trace(info[detail]);  // Displays: Toronto

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Class
» Dynamic object