Copy link to clipboard
Copied
I have a script that makes a dragable strechy string
I was wondering if it was possible through the code im using to change the string graphic to a texture graphic, not sure if it would look great but sounds like a fun experiment.
function item_onMouseMove(event:MouseEvent):void
{
//addChild(wirepick);
//startDrag(wirepick);
line.clear();
// fill color and alpha;
line.beginFill(0xFFFFFF,1);
// line width, color and alpSha;
line.lineStyle(1,0x000000,.1);
if ((mouseX-targetPointX<0 && mouseY-targetPointY>0) || (mouseX-targetPointX>=0 && 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(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 can use the graphics' class beginBitmapFill() method for bitmap fills and lineBitmapStyle for bitmap strokes.
Copy link to clipboard
Copied
you can use the graphics' class beginBitmapFill() method for bitmap fills and lineBitmapStyle for bitmap strokes.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now