• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. Strong Typing > Tricking Flash

Tricking Flash

Not that you'd want to do this, but here's a way to get around strong typing:

var numTrees:Number = 5;
trace(numTrees);           // displays "5"

var treeHack = "numTrees";
this[treeHack] = "leafy green";  // no error happens
trace(numTrees);                 // displays "leafy green"


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint