lundi 23 janvier 2017

Animate / EaselJS - removeEventListener not working

I have an issue w/ Adobe Animate CC, and the Javascript framework it uses, EaselJS/CreateJS. I can add event listeners w/o issue, but I cannot remove them. I have tried various things from the debugger, including stepping into their JS removeEventListener handler - Although the two variables look identical, they are never == (or ===) so the even listener isn't removed.

Here is the code I use, and it's purpose it to fade-in an element when hovering over it:

this.fadeIn = function(target_mc)
        target_mc.alpha = 0;
        target_mc.visible = true;


        function fadeIn_onEnterFrame(evt)
            evt.currentTarget.alpha = evt.currentTarget.alpha + .2;
            if (evt.currentTarget.alpha >= 1)
            } // end if
    } // End of the function

So you know, it is added to the Canvas in frame_0, and is called from a "mouseover" listener added to each clothing type (it's for a drag-and-drop dress-up game, FWIW)

function clothing_onRollOver()
    this.hint_mc.desc_mc.desc1_txt.text = this.articleName;
    this.clothingOver = true;

Aucun commentaire:

Enregistrer un commentaire