I've got an implementation (changeset for review coming up), which compiles
multiframe resources into the following format

   <resource name="lzcheckbox_rsrc">
        <frame src="resources/checkbox_off.swf" />
        <frame src="resources/checkbox_off_mo.swf" />
        <frame src="resources/checkbox_on.swf" />
        <frame src="resources/checkbox_disable_off.swf" />
        <frame src="resources/checkbox_on.swf" />
        <frame src="resources/checkbox_on_mo.swf" />
        <frame src="resources/checkbox_off.swf" />
        <frame src="resources/checkbox_disable_on.swf" />
    </resource>

is transformed to


[Embed(source="/Users/hqm/openlaszlo/devildog/test/swf9/resources/checkbox_off.swf")]
var __embed_lzasset_lzcheckbox_rsrc_0:Class;
[Embed(source="/Users/hqm/openlaszlo/devildog/test/swf9/resources/checkbox_off_mo.swf")]
var __embed_lzasset_lzcheckbox_rsrc_1:Class;
[Embed(source="/Users/hqm/openlaszlo/devildog/test/swf9/resources/checkbox_on.swf")]
var __embed_lzasset_lzcheckbox_rsrc_2:Class;
[Embed(source="/Users/hqm/openlaszlo/devildog/test/swf9/resources/checkbox_disable_off.swf")]
var __embed_lzasset_lzcheckbox_rsrc_3:Class;
[Embed(source="/Users/hqm/openlaszlo/devildog/test/swf9/resources/checkbox_on.swf")]
var __embed_lzasset_lzcheckbox_rsrc_4:Class;
[Embed(source="/Users/hqm/openlaszlo/devildog/test/swf9/resources/checkbox_on_mo.swf")]
var __embed_lzasset_lzcheckbox_rsrc_5:Class;
[Embed(source="/Users/hqm/openlaszlo/devildog/test/swf9/resources/checkbox_off.swf")]
var __embed_lzasset_lzcheckbox_rsrc_6:Class;
[Embed(source="/Users/hqm/openlaszlo/devildog/test/swf9/resources/checkbox_disable_on.swf")]
var __embed_lzasset_lzcheckbox_rsrc_7:Class;
;
LzResourceLibrary.lzcheckbox_rsrc = {frames:
[__embed_lzasset_lzcheckbox_rsrc_0, __embed_lzasset_lzcheckbox_rsrc_1,
__embed_lzasset_lzcheckbox_rsrc_2, __embed_lzasset_lzcheckbox_rsrc_3,
__embed_lzasset_lzcheckbox_rsrc_4, __embed_lzasset_lzcheckbox_rsrc_5,
__embed_lzasset_lzcheckbox_rsrc_6, __embed_lzasset_lzcheckbox_rsrc_7],
width: 15, height: 14};


So the runtime can index that list from LzResourceLibrary, which will return
a class, and instantiate the  asset by just doing a new() on it. That
resource
can be added as a child on the Sprite to make it visible, using addChild().




-- 
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to