i have drawed some figure(circle, rectangle or just a line) and after that i want to change they color without drawing another figure overlaying those, is that possible?
graphics.beginFill(0x000000, 1);
graphics.drawCircle(70, 67, 2);
graphics.drawCircle(90, 67, 2);
graphics.endFill();
after this code is possible to change the color of those circles? lets say some time later…
It is and it isn’t. Once you draw that shape it becomes baked into the draw buffer for that frame. If you’ve drawn it to the main frame-buffer, that’s it, no changies. What you CAN do is draw it to a separate instance of a
SpriteorMovieClipand useColorTransform.and later:
Putting your shape in a
MovieClipalso has the advantage of not having to redraw it on every frame manually (clearing the normal frame-buffer won’t clear theMovieClip‘s) and also means you can move it around easily withmc.xandmc.y.Just out of curiosity, why can’t you set the color when it’s drawn?