[swfmill] passing a variable onto swfmill SWF
Nirav V. Patel
goodbhai at gmail.com
Sun Nov 1 05:44:11 PST 2009
Thank you kindly, Daniel.
Was able to get the variable in the dialect to work with the embedded
SWF in the swfmill ouput SWF. Here is a link to download the files
if anyone would like to test:
Update the hex code in line 19 of the .swfml file.
On Thu, Oct 29, 2009 at 4:25 PM, Daniel Cassidy
<mail at danielcassidy.me.uk> wrote:
> 2009/10/23 Nirav V. Patel <goodbhai at gmail.com>:
>> I was hoping someone could help me find an elegant solution for
>> importing variables to the outputted swfmill SWF.
>> [ ... ]
>> I'm having swfmill generate a textfield on the stage (the text is
>> '336699'). Then I'm using actionscript within an imported SWF
>> (swfmill.swf) to extract the string of the swfmill textfield object to
>> get the variable. It's a few steps to go through, but I was wondering
>> if there was something available within swfmill to import a variable
>> directly without having to go through that process.
> I suppose the cleanest way would be to set a property somewhere that
> can be retrieved from the embedded movie. You can do that by mixing
> the full SWF dialect with the simple dialect. The following example
> sets _global.colorValue = 0x336699, which can then be read back from
> the code in the FLA.
> <?xml version="1.0" encoding="iso-8859-1" ?>
> <movie version="8" width="600" height="400" framerate="12">
> <background color="#000000"/>
> <clip id="mainBanner" import="swfmill.swf"/>
> <clip id="ImportedImage1" import="xml/assets/image1.jpg"/>
> <StackString value="_global"/>
> <StackString value="squareColor"/>
> <StackInteger value="3368601"/>
> <font id="georgia" import="fonts/Georgia"
> <place id="mainBanner" x="0" y="0" depth="1" />
> <place id="squarecolor" name="squarecolorxml" x="10" y="10" depth="2"/>
> and change the code in the FLA to:
> function init1()
> var sqrcolor=new Color ("square");
> I tried the above and it worked for me.
> The easiest way to find out the appropriate XML to set the variables
> you want is to build a simple SWF with code like this on the first
> _global.a = 1;
> _global.b = 2;
> // and so on
> Then run swfmill swf2xml on the resulting SWF and look for the DoAction tag.
> Hope this helps,
> swfmill mailing list
> swfmill at osflash.org
More information about the swfmill