Archive for September, 2007

How to Retrieve FlashVars Data in ActionScript 3.0

Tuesday, September 25th, 2007
ActionScript 3.0 Flash

Last year around this time, I described how to pass variables into a SWF by way of something called FlashVars.  This was discussed in “How to Tell a SWF What File(s) to Load — From the Outside” which works for pretty much any sort of simple data you may want to pass in, as long as you’re talking about relatively small groups of name/value pairs.  Complex data is more likely to be suited to XML.  In that earlier blog entry, the purpose was to re-use a single SWF numerous times to load a variety of MP3 files, by specifying which audio in the HTML.  Pretty flexible solution!  You could use the same technique for loading JPGs or FLVs, to populate dynamic text fields, or whatever you like.  The article has been fairly popular and continues to be useful — as long as your SWF is published for ActionScript 2.0 (or even 1.0 if you drop the post colon suffixes — :String, :Number, and the like).  In ActionScript 3.0, things are different.  Keep reading »