I’m writing a class to create a menu for my new website and I have a question:
If I create the object with AS, how can I attach the classic on(over) etc… to the object I’m creating?
Do I have to extend MovieClip or something like that?
my class is
class menuBar{
public function class(mc:MovieClip) {
draw(mc, Math.round(Stage.height*15/100), Stage.width, 0, Stage.height-Math.round(Stage.height*15/100));
}
private function draw(root:MovieClip, h:Number, w:Number, myX:Number, myY:Number) {
root.beginFill(0x000000);
root.moveTo(myX,myY);
root.lineTo(w,myY);
root.lineTo(w,myY+h);
root.lineTo(myX,myY+h);
root.lineTo(myX,myY);
root.endFill();
}
}
and in the main there is only
var newMenu:menuBar = new menuBar(mcMenu);
where mcMenu is a MovieClip that contains the menu. How can I make the menu reacting to the mouse?