Re: [flexcoders] Questions about createChild() and destroyChildAt()
On 9/27/05, Prasad Dhananjaya [EMAIL PROTECTED] wrote: 1.How can I give mouseOver,mouseOverEffect,mouseOut,mouseOutEffect,mouseUp events to createChild().(check ★).I want to give above affects to all created children which are on the JobNetCanves. (In below code all mouseOver,mouseOverEffect,mouseOut,mouseOutEffect,mouseUp functions are working well) createChild returns the new object. Call setStyle on it to set these effects. Yahoo! Groups Sponsor ~-- Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/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/
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 Yahoo! Groups Sponsor ~-- Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/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/
RE: [flexcoders] Questions about createChild() and destroyChildAt()
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. Yahoo! Groups Sponsor ~-- Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/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/
Re: [flexcoders] Questions about createChild() and destroyChildAt()
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/
[flexcoders] Questions about createChild() and destroyChildAt()
Hi all, Need your help to solve 2 questions about createChild() and destroyChildAt(). My JobNetCanves have some images lines.They all are created by using createChild(). 1.How can I give mouseOver,mouseOverEffect,mouseOut,mouseOutEffect,mouseUp events to createChild().(check ★).I want to give above affects to all created children which are on the JobNetCanves. (In below code all mouseOver,mouseOverEffect,mouseOut,mouseOutEffect,mouseUp functions are working well) 2.Want to delete child at double click. What words I have to write in destroyChildAt(JobNetCanves.getChildAt(★★)); Please help.. thanks - ?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; var isMouseDown:Boolean = false; var lastClickTime:Number = 0; var deleteflag=1; ![CDATA[ [Embed(job1.jpg)] var job51:String; [Embed(job4.jpg)] var job54:String; //double-click function doubleClickDestroyChild(event):Void{ isMouseDown = false; setStyle(borderStyle, none); var now:Number = new Date().getTime(); if (now - lastClickTime 300){ //alert(delete); doDeleteChild(); }else{ lastClickTime = now; } } //destroy child function doDeleteChild() { destroyChildAt(JobNetCanves.getChildAt(★★)); } //mouse over effect function popToTop(target:mx.core.UIObject) { var parent = target.parent; var topSibling = parent.getChildAt(parent.numChildren-1); if (topSibling != target) target.setDepthAbove(topSibling); } //mouse out effect function restore(target:mx.core.UIObject) { var parent = target.parent; var childIndex = parent.getChildIndex(target); if (childIndex parent.numChildren - 1) target.setDepthBelow(parent.getChildAt(childIndex+1)); } //create child function drawImagesAndArrows(target){ ★ var img1=target.createChild(mx.controls.Image,, {source:job51, x:98, y:23,mouseOverEffect:myZoom, mouseOver:popToTop(event.target),mouseOverEffect:myZoom, mouseOut:restore(event.target),mouseOutEffect:cut, mouseUp:doubleClickDestroyChild(event)}); var img4=target.createChild(mx.controls.Image,, {source:job54, x:248, y:98}); var lines_comp =target.createChild(mx.containers.Canvas,,{width:1920,height:1920}); drawLines(lines_comp,140, 40, 235, 100, 8, 0.5) } //draw lines function drawLines(lines,x1, y1, x2, y2, size, sharpness) { lines.lineStyle(2,0x00,100); lines.moveTo(x1,y1); lines.lineTo(x2, y2); } ]] /mx:Script mx:Effect mx:Zoom name=myZoom zoomFrom=100 zoomTo=140 / mx:Zoom name=cut zoomTo=100 duration=1 / /mx:Effect 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 vScrollPolicy=auto backgroundAlpha=0 /mx:Canvas /mx:Canvas /mx:Panel /mx:Application Yahoo! Groups Sponsor ~-- Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/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/
RE: [flexcoders] Questions about createChild() and destroyChildAt()
#2: How about: var iChildIndex as Number = JobNetCanves.getChildIndex(event.target); destroyChildAt(iChildIndex); Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Prasad Dhananjaya Sent: Tuesday, September 27, 2005 5:15 AM To: FlexML Subject: [flexcoders] Questions about createChild() and destroyChildAt() Hi all, Need your help to solve 2 questions about createChild() and destroyChildAt(). My JobNetCanves have some images lines.They all are created by using createChild(). 1.How can I give mouseOver,mouseOverEffect,mouseOut,mouseOutEffect,mouseUp events to createChild().(check ★).I want to give above affects to all created children which are on the JobNetCanves. (In below code all mouseOver,mouseOverEffect,mouseOut,mouseOutEffect,mouseUp functions are working well) 2.Want to delete child at double click. What words I have to write in destroyChildAt(JobNetCanves.getChildAt(★★)); Please help.. thanks - ?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; var isMouseDown:Boolean = false; var lastClickTime:Number = 0; var deleteflag=1; ![CDATA[ [Embed(job1.jpg)] var job51:String; [Embed(job4.jpg)] var job54:String; //double-click function doubleClickDestroyChild(event):Void{ isMouseDown = false; setStyle(borderStyle, none); var now:Number = new Date().getTime(); if (now - lastClickTime 300){ //alert(delete); doDeleteChild(); }else{ lastClickTime = now; } } //destroy child function doDeleteChild() { destroyChildAt(JobNetCanves.getChildAt(★★)); } //mouse over effect function popToTop(target:mx.core.UIObject) { var parent = target.parent; var topSibling = parent.getChildAt(parent.numChildren-1); if (topSibling != target) target.setDepthAbove(topSibling); } //mouse out effect function restore(target:mx.core.UIObject) { var parent = target.parent; var childIndex = parent.getChildIndex(target); if (childIndex parent.numChildren - 1) target.setDepthBelow(parent.getChildAt(childIndex+1)); } //create child function drawImagesAndArrows(target){ ★ var img1=target.createChild(mx.controls.Image,, {source:job51, x:98, y:23,mouseOverEffect:myZoom, mouseOver:popToTop(event.target),mouseOverEffect:myZoom, mouseOut:restore(event.target),mouseOutEffect:cut, mouseUp:doubleClickDestroyChild(event)}); var img4=target.createChild(mx.controls.Image,, {source:job54, x:248, y:98}); var lines_comp =target.createChild(mx.containers.Canvas,,{width:1920,height:1920}); drawLines(lines_comp,140, 40, 235, 100, 8, 0.5) } //draw lines function drawLines(lines,x1, y1, x2, y2, size, sharpness) { lines.lineStyle(2,0x00,100); lines.moveTo(x1,y1); lines.lineTo(x2, y2); } ]] /mx:Script mx:Effect mx:Zoom name=myZoom zoomFrom=100 zoomTo=140 / mx:Zoom name=cut zoomTo=100 duration=1 / /mx:Effect 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 vScrollPolicy=auto backgroundAlpha=0 /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 Yahoo! Groups Sponsor ~-- Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM