This is really aggravating me. I come from a OOP background
so Java and others are natural to me but ActionScript 2 is really
really unintuitive even thought it tries really hard to be a object
oriented language. So sorry if some of my question comes off as
rant/frustration.
I'm trying to extend the MovieClip class but it seems "class
Test extends MovieClip" isn't actually a MovieClip!!! wtf
class Test extends MovieClip {
function Test(){
trace("constructor called");
lineStyle(5, 0xFF00FF, 100);
moveTo(200, 200);
lineTo(300, 300);
lineTo(100, 300);
lineTo(200, 200);
}
}
On frame 1:
import Test;
stop();
var myMc = new Test();
It outputs constructor called, but it doesn't draw anything
and in true Actionscript fashion, outputs no errors or warnings
whatsoever.
It seems that a class that extends a MovieClip isn't actually
a MovieClip. So much for that "is-a" relationship that its supposed
to have. or i guess it gives you access to the MovieClip functions,
but theres no point because theres no MovieClip on the stage...
Sure I suppose I could create an empty movie clip in the
constructor and put things in there, but then whats the point of
extending MovieClip? If Test really is a MovieClip it should be
able to draw on itself.
What am I not getting???