Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Change color style to bitmap or image

New Here ,
Dec 29, 2012 Dec 29, 2012

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();

}

TOPICS
ActionScript
595
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 29, 2012 Dec 29, 2012

you can use the graphics' class beginBitmapFill() method for bitmap fills and lineBitmapStyle for bitmap strokes.

Translate
Community Expert ,
Dec 29, 2012 Dec 29, 2012
LATEST

you can use the graphics' class beginBitmapFill() method for bitmap fills and lineBitmapStyle for bitmap strokes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines