/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function insertIntoArray( array:Array, itm, at:uint ):void { var i:uint = 2 var b:Array = array.slice( 0, at ); var c:Array = array.slice( at ); b.push( itm ); a = b.concat(c); } //test var a:Array = new Array( 0,1,2,3,5,6,7); insertIntoArray( a, 4, 4 ); trace( a );