SKITSANOS FOR RIA

Skitsanos

Monday, July 28, 2008

Tip: Getting FlashVars values

There is might be a need to retrieve flash variables passed to your ActionScript/Flex application.

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550"
height="400"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
<param name="src" value="app.swf?file=sample" />
<embed type="application/x-shockwave-flash"
width="550" height="400" src="app.swf?file=sample"></embed>
</object>

It is quite simple to get flash variables in application that made with Flex framework:
Application.application.parameters.file;
But application in pure ActionScript, like with using SPAS or AsWing UI frameworks (or totally without any of these), requires a bit different approach. In Actionscript 3 variables that are passed in through query string have been moved to the parameters property of LoaderInfo instance.
LoaderInfo(this.root.loaderInfo).parameters.file

0 comments:

Webware development dedicated blog by Skitsanos R&D Labs. ASP.NET, XML, RIA, Adobe Flex, ActionScript 3, AIR, AJAX, Web 2.0, Backbase, CGI development with RealBasic and other web development issues.
News
Downloads