Quantcast
Channel: Adobe Community : All Content - AIR Bugs and Performance Issues
Viewing all articles
Browse latest Browse all 1419

writeObject not writing arrays properly

$
0
0

When creating a new array and assigning a value to element 32, 36, 40, 44, etc before assigning a value to element 0 causes writeObject to behave strangely.

 

The problem occurs with the following code:

 

var array:Array = new Array();

//array[0]=0;

array[32]=1;

array[0]=0;

var  byteArray:ByteArray = new ByteArray();

byteArray.writeObject(array);

byteArray.position=0;

array = byteArray.readObject();

trace(array);

 

Only array[0] will be defined and aray[0]==1, which is clearly not how this code is expected and intended to work, but when the line that is now a comment is added it does work as expected.


Viewing all articles
Browse latest Browse all 1419

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>