views:

33

answers:

1

I get Index out of bounds when trying to readObject on my Byte array into the XML object.

private var fr:FileReference;
private var data:ByteArray = new ByteArray();
[Bindable]
private var dataXML:XML = new XML();

...

public function onLoadComplete(e:Event):void
        {
            trace("Load Complete");
            data = fr.data;
            dataXML = data.readObject();
        }

The Byte array is created by loading a file using FileReference

A: 

Try this...

data = fr.data;
data.position = 0;
dataXML = data.readObject();
PatrickS
I tried this already, still index out of bounds. It seems data.toString() wrapped in an anonymous XML object and assigned to dataXML
Hamid