Reputation: 3
I am allowing user to draw any shape dynamically and then i want to apply color for entire movieclip. say for example user has drawn circle, applying colortransform or graphics, colors only the circle line and leaving the inner portion of the circle uncoloured. I am using moviclip property graphics and allowing the user to draw anything. colortransform is not helping to color entire thing drawn dynamically, Is there any other way achive this. Is there any property to do this....
example Code:(not entire code)
drawArcMc.graphics.lineStyle(2,0xff0000);
drawArcMc.graphics.moveTo(startX,startY);
drawArcMc.graphics.lineTo(evt.stageX,evt.stageY);
Now if try to color this mc, only the line drawn get colored, not the entire mc(exmaple circle)..hope you get it, what i am trying to convey..Thanks in advace..
Upvotes: 0
Views: 105
Reputation: 10659
You can use colorTransform to tint a movieclip. E.g.:
var color:int = 0xff0000;
mymc.transform.colorTransform = new ColorTranform(0, 0, 0, 1, (color & 0xff0000) >> 16, (color & 0x00ff00) >> 8, color & 0x0000ff);
This replaces any color in the movieclip with the color defined in the color
variable.
Upvotes: 0
Reputation: 3510
Try beginFill, like this:
drawArcMc.graphics.beginFill(0xff9900);
drawArcMc.graphics.lineStyle(2,0xff0000);
//draw your shape here..
drawArcMc.graphics.endFill();
so you should set the beginFill & lineStyle before you start drawing and endFill once you'r done..
Upvotes: 0