* Makes an embedded bitmap class that extends from mx.core.BitmapAsset. * This is to emulate the embedding of bitmapData so that we can use * assets loaded from folder at runtime and pretend that they were * embedded. * * FINAL LOGIC ON HOW TO CREATE: * 1. I couldn't figure out how to define a custom constructor code, and making just certain properties * valid using the IPropertyBuilder seemed a little shotty. I wanted my new object to behave identially to * an embedded asset. * * 2. Solution: * A: I extended from the embedded asset type for bitmaps ( mx.core.BitmapAsset ) and made * my own class BitmapAssetWrapper. * B: BitmapAssetWrapper has a static dictionary where I bind the unique fully qualified name * of the dynamically constructed class before I build that dynamic class. * C: After the dynamic class is built, it's constructor will use describeType() * to get the fullyQualified name of it'self. It will then use that fully qualified name to * fetch the correct bitmapData from the static dictionary. Once it has the correct bitmap * that is supposed to be linked to that class, that bitmap is used in the super() of the * BitmapAssetWrapper's constructor. * D: The result is functionally, the creation of a dynamically generated mx.core.BitmapAsset * That will allow me to EMULATE the embedding of assets. By allowing the emulation of embedded * assets, I have made it so that I can use assets loaded at runtime, or assets loaded at compile time, * without having to change anything.
Monday, November 11, 2013
Embedded Asset Emulation at Runtime using AS3Commons.byteCode
After being up all night, here are the notes from my header file on how I was
able to dynamically create embedded assets at runtime.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment