problem with graphic sprite inside a MovieClip Class
¡Hola!.
Hello!.
I have a MovieClip "panelMenu" class.
Inside the class he drew a rectangle (cap) to use later in an event.
What happens is that I do not see the rectangle! No matter how much I put it in one place or another, it can't be seen! This code works perfectly in the action panel, but when passing it to a class I cannot make the rectangle display.
addChild does not work and there is no compiler error.
Thanks for the help
package componentes {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.display.Sprite;
public class panelMenu extends MovieClip {
var tapa:Sprite;
public function panelMenu() {
tapa = new Sprite();
tapa.graphics.beginFill(0x8A9597, 1);
tapa.graphics.drawRect(0,0,180,800);
tapa.graphics.endFill();
tapa.alpha = 0.8;
function playMenu (event:MouseEvent):void{
if (currentLabel == "uno"){
play();
addChild(tapa);
}
}
function retryMenu (event:MouseEvent):void{
if (currentLabel == "diez"){
play();
removeChild(tapa);
}
}
addEventListener (MouseEvent.CLICK, playMenu);
tapa.addEventListener (MouseEvent.CLICK, retryMenu);
}
}
}
