Converting Arrays into Objects in Actionscript 3.0

When using a SharedObject to save data in AS3, it is necessary to convert Arrays() to Objects() when saving and loading the data. The following code will convert Arrays() into Objects().

private function toObject(a:Array):Object
var o:Object = new Object();

for(var i:int = 0; i < a.length; i++) { o[i] = a[i]; } return o; }

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditShare on StumbleUponShare on TumblrEmail this to someone

Leave a Reply

Your email address will not be published.