[swfmill] Loading assets from runtime-loaded SWFs generated by swfmill (+followup for Jonas)

armencho at gmail.com armencho at gmail.com
Fri Nov 6 04:52:30 PST 2009


Hi all,

Since sooner or later I will personally need to instantiate assets
defined in SWFs I generate with swfmill,
and since in trying to help Jonas earlier I have discovered that it
might turn out to be impossible, I would like to aggregate some
knowledge here, on how it IS possible to do that.

Basically, I have xmls that define assets - usually fonts (using
'font' in simple dialect) and images (using 'bitmap') -
which I need to load into my application (developed in haXe) ON
DEMAND, i.e. at runtime.

The big problem is, none of it works, because the workhorse of
instantiating assets - ApplicationDomain::getDefinition (Flash Player
native API) - fails to find the asset classes in these asset SWF files
that I generate with swfmill.

Digging further, I found out it is probably (to my limited
understanding) because swfmill does not generate "class stubs" for
these assets automatically. Basically assets are indeed embedded, and
work when assisted by a followup tool (f.e. haXe generates class stubs
for assets it finds in 'statically linked' SWFs when using "-swf-lib"
switch), but I would like to rely on swfmill only, because most of my
builds are automated, and I do not want to create additional
dependencies on haXe or SamHaxe f.e.

I am wondering what are my options here, and is my analysis of the
situation correct? I would very much like to continue using swfmill, I
find its "ideology" very suitable for my needs. I mean the whoel
"xml-swf translation" is an ingenious concept, if you ask me.



More information about the swfmill mailing list