Copy link to clipboard
Copied
hello!
i have chalange with remove child
i wrote this code
in button_2 the code removed olny the child from empty but not from empty1
what's wrong in the code??
this["empty"].addChild(new lib["picword14"]());
this["empty1"].addChild(new lib["picword14"]());
this.button_2.addEventListener("click", fl_ClickToGoToAndPlayFromFrame_2.bind(this));
function fl_ClickToGoToAndPlayFromFrame_2()
{
this["empty"].removeChildAt();
this["empty1"].removeChildAt();
}
this.button_3.addEventListener("click", fl_ClickToGoToAndPlayFromFrame_3.bind(this));
function fl_ClickToGoToAndPlayFromFrame_3()
{
this["empty"].addChild(new lib["picword14"]());
this["empty1"].addChild(new lib["picword14"]());
}
Copy link to clipboard
Copied
Hi.
You're using the removeChildAt method which requires an index. E.g.:
this["empty"].removeChildAt(0);
Just provide an index or use the removeChild method instead.
Regards,
JC
Copy link to clipboard
Copied
thank you
it its work