Publishers of technology books, eBooks, and videos for creative people

Home > Blogs > LoaderInfo, Five ActionScript Tips in Five Days, Part 3

LoaderInfo, Five ActionScript Tips in Five Days, Part 3

Loading external variables into Flash opens up a whole world of possibility.

In the past, _root was used to access variables passed via the FlashVars attribute. In ActionScript 3, the code you use is much more official; in fact, there is even a new class named LoaderInfo. You can use gthe LoaderInfo class to access these external variables within Flash. The first thing that needs to happen is the passing of the external variables via the FlashVars tag into Flash.

Once FlashVars is passing variables, the LoaderInfo class can be used to access the variables values. The new root object inherently contains a loaderInfo instance, which is used to access parameters or key/value pairs sent through FlashVars.

Keep your eyes out for more ActionScript 3 tips like these each day this week.

And for more on ActionScript, be sure to check out my book ActionScript 3.0 Migration Guide, The: Making the Move from ActionScript 2.0.