Hi Nischal, Thanks a lot. Now it works.
Regards, Prasad > Prasad: > > Use "JobNetCanves.destroyChildAt(iChildIndex);" statement to remove child > element. > > > Regards, > Nischal Pathania > ________________________________________ > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of > Prasad Dhananjaya > Sent: Friday, September 30, 2005 06:05 > To: flexcoders@yahoogroups.com > Subject: Re: [flexcoders] Questions about createChild() and destroyChildAt() > > Hi all, > > Still I have a problem with destroyChild().I want to destroy only "img1". > But it destroys every thing on the application including panel,canvas. > Not only selected child. > > can someone tell me why it is destroying every thing. > > thanks > Prasad > > ----------------------------------------------------------------------------- > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" > pageTitle="Test Aplication"> > <mx:Script> > import mx.managers.DepthManager; > import mx.utils.Delegate; > > <![CDATA[ > [Embed("job1.jpg")] > var job51:String; > > //destroy child > function doubleClickDestroyChild(event):Void{ > var iChildIndex:Number = > JobNetCanves.getChildIndex(event.target); > destroyChildAt(iChildIndex); > } > > //create child > function drawImagesAndArrows(target){ > var > img1=target.createChild(mx.controls.Image,"", {source:job51, x:98, y:23}); > > img1.addEventListener("mouseUp",Delegate.create(this, > doubleClickDestroyChild)); > } > ]]> > </mx:Script> > > <mx:Panel width="100%" height="100%" title="Mypanel"> > <mx:Canvas width="100%" height="100%"> > <mx:Canvas id="JobNetCanves" > x="0" y="110" width="100%" height="225" > initialize="drawImagesAndArrows(event.target)" > backgroundColor="#DEE0FE" > > </mx:Canvas> > </mx:Canvas> > </mx:Panel> > </mx:Application> > > > > -- > 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 > > * Visit your group "flexcoders" on the web. > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > * Your use of Yahoo! Groups is subject to the 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 > > > > > ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM --------------------------------------------------------------------~-> -- 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/