Copy link to clipboard
Copied
Using AS3 code, is it possible to combine 2 graphics or more into one?
Example : combining a rectangle and a triangle to make a nice arrow?
Do you know anything about AS3 drawing API - I guess this is what you need to use:
This is an example of how one can draw rectangle:
var sp:Sprite = new Sprite();
sp.graphics.beginFill(0xff0000);
sp.graphics.drawRect(0, 0, 100,200);
sp.graphics.endFill();
addChild(sp);
Read:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Graphics.html
And this:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000176.html
Copy link to clipboard
Copied
Yes, it is possible.
Copy link to clipboard
Copied
Do you have a handy example for whatever shapes?
Copy link to clipboard
Copied
Do you know anything about AS3 drawing API - I guess this is what you need to use:
This is an example of how one can draw rectangle:
var sp:Sprite = new Sprite();
sp.graphics.beginFill(0xff0000);
sp.graphics.drawRect(0, 0, 100,200);
sp.graphics.endFill();
addChild(sp);
Read:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Graphics.html
And this:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000176.html
Copy link to clipboard
Copied
many thanks
Copy link to clipboard
Copied
You are very welcome.