The bitmap resource, It's usually make the bitmap generate the SWF file ,and use Loader class to load into the application. I search some answers from google, find two ways to generate SWF File, one. use mxmlc tool. and another, use jsfl. I know we can embed the bitmap or swf file into As code. and use mxmlc command like this: the as file is Vip.as , and the code :
package
{
public class Vip
{
[Embed(source="vip.gif"]
public static var vip:Class;
}
}
and now, I use mxmlc Vip.as ... It's has Vip.swf file, upload the Vip.swf file to Server. Then, In flashBuilder, create a new ActionScript project, the application code is :
public class LoadUI extends Sprite
{
public function LoadUI()
{
init();
}
private function init():void {
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
var context:LoaderContext = new LoaderContext();
context.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load( new URLRequest('http://localhost/swfResouce/Vip.swf'));
}
private function completeHandler(e:Event):void {
var loaderInfo:LoaderInfo = e.currentTarget as LoaderInfo;
}
and debug the application, Error is:
VerifyError: Error #1014: Class Not Found mx.core::BitmapAsset.
I don't know how to use mxmlc generate swf file . And no error when debug the code.
Another way is that use JSFL to generate SWF in flash cs5, But I don't know how to use this. Ah, very pain.