Instead of assigning the objects to each other you can actually copy the objects using arrColl1 = ObjectUtil.copy(arrColl2) as ArrayCollection;
On Wed, Oct 28, 2009 at 1:24 PM, surendra <[email protected]>wrote: > > Hi, > > I got some issue on array collection can any one solve that. > > I have a Array collection and i am assigning the list to 3 array > collection variables, and now i am removing the list of particular > variable. > But all the variables list are removing. > Below is the Example > <?xml version="1.0" encoding="utf-8"?> > <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" > height="100%" creationComplete="init()"> > > <mx:Script> > <![CDATA[ > import mx.controls.Alert; > import mx.collections.ArrayCollection; > > var one:ArrayCollection; > var two:ArrayCollection; > var three:ArrayCollection; > > private function init():void { > > one = new ArrayCollection(); > > one.addItem(new Object()); > one.addItem(new Object()); > one.addItem(new Object()); > > Alert.show("One :: "+one.length); > > two = one; > three = one; > > Alert.show("Two :: "+two.length+" three :: > "+three.length); > > > } > > private function onClick():void { > two.removeAll(); > > Alert.show("One :: "+one.length+" two :: > "+two.length+" > three :: "+three.length); > } > > ]]> > </mx:Script> > > <mx:Button label="Test" click="onClick()"/> > > </mx:VBox> > > I am getting all the variables length as 0,after click on button. > > thanks in advance, > surendra. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

