I'm trying to make a shape available for duplicating. Here's an explanation of what I've done, what I'm trying to do, and where I'm stuck:
- Drew a shape manually in the Flash IDE (paintbrush).
- Created a new movieclip containing the shape; exports as a class.
- Instantiate the class (var mc:MovieClip = new shapeMovieClip()).
- Add a reference to the shape in mc that I want (var myShape:Shape = mc.getChildAt(0) as Shape;
- This works perfect and I now have my shape, but how can I duplicate it without instantiating the parent MovieClip class - is it possible?
I've tried creating a new shape and using the copyFrom() graphics method with no avail, I believe this method just copies draw calls when they're made on the referenced graphics and instead I just have a reference of a shape that's already been drawn.
Right now I'm extending the movieclip as a sprite instead, instantiating, pulling the shape from the parent and saving its reference, and then nulling the sprite. Does anyone know of a better, more lightweight, strategy for duplicating Shapes in this manner?