Question
Beginner function help
What is wrong with this code? (HTML5 canvas) The first way works, but the second way doesn't.
var _this = this;
stage.enableMouseOver(3);
_this.icon_1.on('mouseover', function(){
_this.icon_1.gotoAndPlay('over');
_this.icon_1.cursor = "pointer";
});
_this.icon_1.on('mouseout', function(){
_this.icon_1.gotoAndPlay('out');
});I need to do this for over 10 icons so I wanted to make it more module so I tried to convert it like this but it does nothing -
var _this = this;
stage.enableMouseOver(3);
_this.icon_1.addEventListener("mouseover", fl_MouseOverHandler);
function fl_MouseOverHandler()
{
gotoAndPlay('over');
cursor = "pointer";
}
_this.icon_1.addEventListener("mouseout", fl_MouseOutHandler);
function fl_MouseOutHandler()
{
gotoAndPlay('out');
}
