how to embed pure as3 bitmap assets with flex4 (worked with flex3)

Posted by jedierikb on Stack Overflow See other posts from Stack Overflow or by jedierikb
Published on 2010-04-19T02:44:03Z Indexed on 2010/04/19 2:53 UTC
Read the original article Hit count: 807

Filed under:
|
|
|
|

In Flex3, I could compile pure as3 code and use "embed" tags to load in images. This was done by Flex making a BitmapAsset class.

I can still do this in Flex4.

However, there was a trick to fakeout flex3 and use my own mx.core.BitmapAsset class to remove some of the extraneous stuff Flex's BitmapAsset brings in with it. This is described here: http://www.ultrashock.com/forums/flex/embed-flex-assets-without-using-flex-123405.html

Unfortunately, I cannot get these tricks to work with Flex4 and get smaller file sizes. I end up with the error "VerifyError: Error #1014: Class mx.core::BitmapAsset could not be found."

This error leads me to this forum, and a solution as described there: http://tech.groups.yahoo.com/group/flexcoders/message/148762

Following this advice, I add -static-link-runtime-shared-libraries=true, and my swf loads without an error... but this means I am loading in the pieces of the flex framework I wanted to omit (and the file size says so too).

Is there a better way to fake out flex4 when it comes to using Embed?

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about flex3