I can't add a movieclip to the stage using a function
Hi.
I am trying to add a movieclip to the stage from the library.
The mc has a linkage name in the library of popup_Tania.
At the end of the code, inside the if statement, I try and call the function with this.addPopuup()
It doesn't work.
this.stop(); //stop here on first frame
this.s1_b1.visible =false;
this.s1_b2.visible =false;
this.s1_b3.visible =false;
this.s1_b4.visible =false;
this.engagement_container.visible=false;
btn_integer = 0;
this.btn.addEventListener("click", clickHandler.bind(this));
function clickHandler(event)
{
btn_integer = btn_integer + 1;
if (btn_integer == 1) {
this.s1_b1.visible = true;
this.engagement_container.visible=true;
} else if (btn_integer == 2) {
this.s1_b2.visible=true;
} else if (btn_integer == 3) {
this.s1_b3.visible=true;
} else {
this.s1_b4.visible=true;
this.addPopup();
}
}
function addPopup() {
this.s1_b4.visible=false;
var Tania = new lib.popup_Tania();
Tania.x = 150;
Tania.y = 250;
this.addChild(Tania);
}
