[Flex3] painful ‘Unable to resolve asset for transcoding’ error

I ran into this error when I was trying to embed an swf into one of my classes like this:

    [Embed(source='assets/aaa.swf',symbol='bbb')]
    private var bbb:Class;


It gave no error in Flex Builder, but when I was about to build the application using standalone compiler and deploy to production, an error was thrown out:

unable to resolve 'assets/aaa.swf' for transcoding


The solution was easy: just to append a '/' in front of assets like this:

    [Embed(source='/assets/aaa.swf',symbol='bbb')]
    private var bbb:Class;


Damn unbelievable. I was wondering why the compiler in FB didn't complain in the first place.

你可能感兴趣的:(java,Flex)