give a look at createChild()
At 04:49 PM 7/6/2005, you wrote: >Am using Tile not TileList ...is there an equivalent of addItem for the Tile >component ? > >- superabe > >----- Original Message ----- >From: "Manish Jethani" <[EMAIL PROTECTED]> >To: <flexcoders@yahoogroups.com> >Sent: Wednesday, July 06, 2005 4:07 PM >Subject: Re: [flexcoders] add / remove item in a Tile directly > > > > On 7/6/05, superabe <[EMAIL PROTECTED]> wrote: > > > >> Is there any way to add a previously removed child back into a Tile > >> without > >> changing the dataprovider? > > > > I don't think that's a wise thing to do, because it would interfere > > with the TileList's own item management functionality. If you've > > specified a dataProvider then you should modify the dataProvider > > directly (using the add/remove functions of the TileList class). > > > > <?xml version="1.0"?> > > <mx:Application > xmlns:mx="<http://www.macromedia.com/2003/mxml>http://www.macromedia.com/2003/mxml" > > xmlns="*"> > > <mx:String id="savedItem" /> > > <mx:Script> > > function removeItemAndSave():Void > > { > > savedItem = tl.getItemAt(1); > > tl.removeItemAt(1); > > } > > function restoreSavedItem():Void > > { > > tl.addItem(savedItem); > > savedItem = null; > > } > > </mx:Script> > > <mx:TileList id="tl" dataProvider="{['1', '2', '3']}" /> > > <mx:Button label="Remove" click="removeItemAndSave()" /> > > <mx:Button label="Add" click="restoreSavedItem()" /> > > </mx:Application> > > > > Children removed using destroyChild cannot be added back, AFAIK. > > > > > > -- > > Flexcoders Mailing List > > FAQ: > <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > > Search Archives: > <http://www.mail-archive.com/flexcoders%40yahoogroups.com>http://www.mail-archive.com/flexcoders%40yahoogroups.com > > Yahoo! Groups Links > > > > > > > > > > > > > > > >-- >Flexcoders Mailing List >FAQ: ><http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt >Search Archives: ><http://www.mail-archive.com/flexcoders%40yahoogroups.com>http://www.mail-archive.com/flexcoders%40yahoogroups.com > > > ><?---- LSpots keywords ?> <?---- HM ADS ?> > >---------- >YAHOO! GROUPS LINKS > > * Visit your group > "<http://groups.yahoo.com/group/flexcoders>flexcoders" on the web. > * > * To unsubscribe from this group, send an email to: > * > <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED] > > * > * Your use of Yahoo! Groups is subject to the > <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service. > > >---------- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/