array clone is done quite easy. see this: var old_array:Array = new Array(1, 2, 3, 4); var new_array:Array = old_array.concat(); new_array.shift(); trace(old_array+" : "+new_array);
2006/3/3, eric dolecki <[EMAIL PROTECTED]>: > > I agree with Michael... > > import mx.utils.ObjectCopy; > > obj = new Object(); > obj.color = "red"; > > obj2 = ObjectCopy.copy( obj ); > obj2.color = "blue"; > > trace( obj.color ); > trace( obj2.color ); > > > This should work with an Array Object as well I assume > > > On 3/2/06, Michael Klishin <[EMAIL PROTECTED]> wrote: > > > > Wade Arnold wrote: > > > Is it possible to clone and array in AS 2.0? I have copied the array > > but > > > that just places a pointer at the existing array. I am looking to > > > clone/duplicate the array to separate the two data elements without > > having > > > to do a for loop. This of course stops working once you use objects or > > > multi-dimensional arrays. > > > > Isn't it a job for mx.utils.ObjectCopy class and it's static copy > method? > > > > -- > > Michael "Antares" Klishin, > > > > Email: [EMAIL PROTECTED] > > Web: www.novemberain.com > > > > Non progredi est regredi > > _______________________________________________ > > Flashcoders@chattyfig.figleaf.com > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com