2

I have a swf which embeds around 40 various png and fxg objects using the embed metatag... eg.:

public class OneOfMyEbeddedAssets
{
    [Embed(source = "./assets/OneOfMyEbeddedAssets.png")]
    private static const shapeClass: Class; 

    public static function get bitmapData():BitmapData
    {
        var bm:Bitmap = new shapeClass();
        return bm.bitmapData;
    }
}

When it compiles with the incremental tag, I notice a number of classes and fxgs are recompiled each time, saying "Reason: one of the assets has been updated", or "Reason: It's dependent file, .as has been updated". The build completes successfully.

Then, when I run my application, I get a message in the flash log:

[Fault] exception, information=ReferenceError: Error #1065: Variable
OneOfMyEbeddedAssets_shapeClass is not defined.

When I explore the swf file, and look at the Symbols embedded in it, I can see the required shape class has actually been embedded properly. The message is not for every embedded asset, just one in particular; and not necessarily the first one accessed in the code.

The problem disappears if I don't do an incremental compile... any ideas why?

Cookie
  • 287
  • 4
  • 9

2 Answers2

1

This is a bug.

I found the exact reproduction steps so hopefully this bug can get upvoted and fixed.

Peter Lang
  • 54,264
  • 27
  • 148
  • 161
0

I think this a known bug with embedding assets and incremental compile not working correctly.

See Here

Community
  • 1
  • 1
jai
  • 2,931
  • 1
  • 14
  • 4