I’m using one of senoculars tutorials for duplicating graphics, it uses 2 as class files, and I get what the problem is I just don’t get why it doesn’t recognize it here’s the error: 1046: Type was not found or was not a compile-time constant: MyShape.
import com.shapes.MyShape;
var shape1:MyShape = new MyShape();
shape1.graphicsCopy.beginFill(0xFF80);
shape1.graphicsCopy.lineStyle(2, 0);
shape1.graphicsCopy.drawRect(0, 0, 50, 50);
// draw shape2 using shape1's copied drawing
var shape2:MyShape = new MyShape();
shape2.graphicsCopy.copy(shape1.graphicsCopy);
// add to display list
addChild(shape1);
addChild(shape2);
shape2.x += 100;
and here’s the MyShapes.as
package com.shapes {
import flash.display.Shape;
import com.shapes.GraphicsCopy;
class MyShape extends Shape {
// graphicsCopy property
private var _graphicsCopy:GraphicsCopy;
public function get graphicsCopy():GraphicsCopy {
return _graphicsCopy;
}
// constructor
function MyShape(){
_graphicsCopy = new GraphicsCopy(graphics);
}
}
}