/ Published in: ActionScript
Expand |
Embed | Plain Text
// set clone items function function CLONE_ITEMS (itemsArray) { // create temp items array tempItems = new Array(); // loop through each object in items array for (currentItem in itemsArray) { // create new object for current item tempItems[currentItem] = new Object(); // loop through current item for (currentObject in itemsArray[currentItem]) { // tempItems[currentItem][currentObject] = itemsArray[currentItem][currentObject]; } } // return tempItems; }
Comments
Subscribe to comments
You need to login to post a comment.

There is a much shorter way in AS3:
var a:Array = [1, 2, 3, 4, 5]; var b:Array;
b = a.map(function(e:*, ...r):*{ return e });
in my last post, there must be an asterisk after "e:" - it did not get through
should be b = a.map(function(e:*, ...r):*{ return e });
should be b = a.map(function(e:*, ...r):*{ return e });