# Loading animation using byteArrays

**URL:** <https://forum.kirupa.com/t/loading-animation-using-bytearrays/312123>\
**Category:** flash\
**Created:** [July 26, 2010, 11:12am UTC](https://forum.kirupa.com/t/loading-animation-using-bytearrays/312123 "2010-07-26T11:12:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaji](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@shaji](https://forum.kirupa.com/u/shaji)\
**Post date:** [July 26, 2010, 11:12am UTC](https://forum.kirupa.com/t/loading-animation-using-bytearrays/312123/1 "2010-07-26T11:12:42Z")

</div>

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?

```auto

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
    }
}

```
