actionscript 3 - AS3 change line curve -


i have end part of code, need bend in opposite directon. creates line point mouse curves up. need curve down. values change this?

    if ((mousex-targetpointx<0 && mousey-targetpointy>0) || (mousex-targetpointx>=0 && mousey-targetpointy<=0))     {         if (mousey-targetpointy>0)         {             line.moveto(mousex-offset,mousey-offset);             line.curveto(mousex-offset,targetpointy-offset,targetpointx-offset,targetpointy-offset);             line.lineto(targetpointx+offset,targetpointy+offset);             line.curveto(mousex+offset,targetpointy+offset,mousex+offset,mousey+offset);         }         else         {             line.moveto(mousex-offset,mousey-offset);             line.curveto(targetpointx-offset,mousey-offset,targetpointx-offset,targetpointy-offset);             line.lineto(targetpointx+offset,targetpointy+offset);             line.curveto(targetpointx+offset,mousey+offset,mousex+offset,mousey+offset);         }     }     else     {         if (mousex<targetpointx && mousey<targetpointy)         {              line.moveto(mousex-offset,mousey+offset);             line.curveto(targetpointx-offset,mousey+offset,targetpointx-offset,targetpointy+offset);             line.lineto(targetpointx+offset,targetpointy-offset);             line.curveto(targetpointx+offset,mousey-offset,mousex+offset,mousey-offset);         }         else         {             line.moveto(mousex-offset,mousey+offset);             line.curveto(mousex-offset,targetpointy+offset,targetpointx-offset,targetpointy+offset);             line.lineto(targetpointx+offset,targetpointy-offset);             line.curveto(mousex+offset,targetpointy-offset,mousex+offset,mousey-offset);         }     }     line.endfill(); }  } 

you need change control points in curveto methods, first 2 parameters.

curveto(controlpointx,controlpointy,targetx,targety); 

http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/display/graphics.html#curveto()


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -