timeline actions not working inside a function HTML Canvas
Hello all thanks for your time
I have a problem calling a timeline action inside a function, the movie clip i use in the function always comes out as undifined.
but when i call the action from within a button function it works as normal.
function reset() {
this.rhpump_mc.gotoAndStop(0);
console.log(2)
this.lhpump_mc.gotoAndPlay(51);
}
then i have a button
this.stop_btn.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler(e)
{
console.log(2)
reset()
}
console comes up with both movie clips undefined
but if i put the code all within the button like this .
this.stop_btn.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler(e)
{
this.rhpump_mc.gotoAndStop(0);
console.log(2)
this.lhpump_mc.gotoAndPlay(51);
}
I get no errors and it all functions normally
I must be doing something wrong .
Thank you for your help
PETER
