Adding mx.* libraries to FDT
For my most recent AS3 project, I’ve settled on developing in Eclipse/FDT and have set up the Flex compiler for building. In general, this works great, but every so often you run across a snag, as the FDT/Flex setup has its quirks.
Today, I added a SWF asset to my main class, like so:
[Embed(source="../../assets/frame.swf")]
[Bindable]
public var Frame:Class;
but upon compiling, mxmlc threw the following error:
Error: The definition of base class MovieClipLoaderAsset was not found.
It would appear that using the [Embed] metatag requires the presence of some classes you’re not going to get by default.
A quick Spotlight search later revealed MovieClipLoaderAsset.as in the following location:
{Flex SDK}/frameworks/projects/framework/src/mx/core
Adding the framework source folder:
{Flex SDK}/frameworks/projects/framework/src
to my project as a new linked library solved the problem and the compiler was happy again.
I leave this note here in the hope that it proves useful to someone else one day ;)
January 20th, 2010 at 9:18 am
Bam!
Useful this day.
Ta!