swfmill を介して新しい swf ファイルを作成するために使用する XML の一部があります。
<?xml version="1.0" encoding="iso-8859-1" ?>
<movie width="300" height="250" framerate="24">
<background color="#ffffff"/>
<frame>
<library>
<clip id="test_swf" import="test.swf"/>
</library>
<place id="test_swf"/>
</frame>
</movie>
FlashVars を使用して行うことができるように、ステージにロードするテキストや画像などの変数をこの swf に渡したいと思います。<param name=FlashVars value="oneText=Hello%20World&oneImage=image.jpg" />
ありがとうございました!
少し更新:
このようにパラメータをGET変数として与えようとしました
<clip id="test_swf" import="test.swf?theValue=Hello%20World"/>
しかし、それは機能せず、コピー時に次のエラーが発生しました:
WARNING: Cannot import test.swf?oneValue=Hello%20World (unknown extension), skipping.
2回目の更新
いくつかの検索の後、swfmill 出力 swf で変数を埋め込み SWF に渡す正しい方法を確立する方法を見つけました。もちろん、@little update を使用した方法はひどく間違っていました。
xml コードは次のようになります。
<?xml version="1.0" encoding="iso-8859-1" ?>
<movie version="8" width="600" height="400" framerate="24">
<background color="#000000"/>
<frame>
<library>
<clip id="main" import="test.swf"/>
</library>
<DoAction>
<actions>
<Dictionary>
<strings>
<String value="_global"/>
<String value="aa"/>
<String value="Hello world"/>
<String value="bb"/>
<String value="image.jpg"/>
</strings>
</Dictionary>
<PushData>
<items>
<StackDictionaryLookup index="0"/>
</items>
</PushData>
<GetVariable/>
<PushData>
<items>
<StackDictionaryLookup index="1"/>
<StackDictionaryLookup index="2"/>
</items>
</PushData>
<SetMember/>
<PushData>
<items>
<StackDictionaryLookup index="0"/>
</items>
</PushData>
<GetVariable/>
<PushData>
<items>
<StackDictionaryLookup index="3"/>
<StackDictionaryLookup index="4"/>
</items>
</PushData>
<SetMember/>
<EndAction/>
</actions>
</DoAction>
<place id="main" />
</frame>
</movie>
私のアクション スクリプト (AS 2.0) は次のようになります。
_root.text_input.text = _global.aa;
loadMovie( _global.bb ,dropzone,'GET');
trace (_global.aa+' '+_global.bb);
swfmill swf2xml test2.swf
test2.swf の最初のフレームに次の宣言が含まれている場所を使用して、xml に表示されるデータ構造を取得しました。
_global.aa = 'Hello world';
_global.bb = 'someimage.jpg';
どういうわけか、これが良さそうに見えても、変数をグローバル変数として使用できないようです。