Hi,
I am trying to load swf as byteArrays. I am able to load the swf, however I am unable to access movieclip properties. I have the code below… How do I get access to movieclip properties?
var binaryLoader:URLLoader;
var holder:Sprite;
const SWF_URL:String="chase2.swf";
ESWFLoader();
function ESWFLoader():void
{
holder = new Sprite();
this.addChild(holder);
binaryLoader = new URLLoader();
binaryLoader.addEventListener(Event.COMPLETE, onLoadInit);
binaryLoader.dataFormat = URLLoaderDataFormat.BINARY;
binaryLoader.load(new URLRequest(SWF_URL));
}
function onLoadInit(e:Event):void
{
binaryLoader.removeEventListener(Event.COMPLETE, onLoadInit);
var animationLoader:Loader = new Loader();
var binaryData:ByteArray = new ByteArray();
binaryData = binaryLoader.data;
if(binaryData.length != 0)
{
animationLoader.loadBytes(binaryData);
var mc:MovieClip = binaryData.readUTFBytes(binaryData.length) as MovieClip;
holder.addChild(animationLoader);
//Till this line no error
trace(mc.totalFrames); //This line throws error
}
}