copy a shape
Hi ,
I am working in a complicated shape manuplation project.
In that user can join 2 shapes , he can duplicate, he can delete a particular part of a shape ect;
In the following code copies a shape and adds to stage.
import flash.display.Shape;
var sh1:Shape = new Shape();
sh1.graphics.lineStyle(2,0x000000);
sh1.graphics.drawRect(45,45,100,100);
addChild(sh1);
trace(sh1.x);
trace(sh1.y);
sh1.rotation = 45;
trace(sh1.x);
trace(sh1.y);
var sh2:Shape = new Shape();
sh2.graphics.copyFrom(sh1.graphics);
addChild(sh2);
sh2.x = 200;
In this all the properties of sh1 copied except the rotation value.
But i dont want to assign it directly like sh2.rotation = sh1.rotation;
Is there any other way to do that?
Thanks,
Shanthi