Really? A colleague told me that there was some SDK that allowed me to do so. Anyway, say I wrote the following AS2.0 class in an external flash file (.as).
class Triangle {
private var base:Number;
private var height:Number;
private var hypotenuse:Number;
public function setBase(tempBase:Number):Void {
base = tempBase;
}
public function setHeight(tempHeight:Number):Void {
base = tempHeight;
}
public function setHypotenuse(tempHyp:Number):Void {
hypotenuse = tempHyp;
}
public function draw(baseX:Number, baseY:Number):Void {
var drawObj:MovieClip = new MovieClip();
drawObj.moveTo(baseX, baseY);
drawObj.lineTo(base, 0);
drawObj.lineTo(0, height);
drawObj.lineTo(-base, -height);
}
}
How would I go about implementing this flash in my Main flash file (fla) I tried
#include "Triangle.as"
but it gave me this error
**Error** Triangle.as: Line 1: Classes may only be defined in external ActionScript 2.0 class scripts.
Can I not use my custom class files in my FLA productions?