You have some pretty and interactive animations, which are created using Flash Authoring Tool and you need to embed them without losing interactivity into project which compiled using Flex compiler.
You have to embed SWF file using [Embed] metatag with param mimeType="application/octet-stream". Then, load embedded asset using Loader.loadBytes() method. Pass LoaderContext with ApplicationDomain.currentDomain as second argument to Loader.loadBytes(). Then just wait 1 frame – and you can use all possibilities of your SWF.
For example, you have coolAnimation.swf with a coolest animation in the world. The root class of this SWF has the method startAnimation(). Let's try to embed it.
First embed SWF into some variable:
[ Embed ( "coolAnimation.swf" , mimeType= "application/octet-stream" )] private var CoolAnimationAsset:Class;
mimeType="application/octet-stream" will tell Flex not to parse our SWF. So Flex won't know which type of file we trying to embed.
After embed CoolAnimationAsset will be ByteArrayAsset which is extender of ByteArray. So we can load it using Loader class:
private var myLoader:Loader = new Loader();