mercredi 23 novembre 2016

Adobe Animate - Controlling outside movie clip on MouseOver

I created HTML5-canvas with movie clip on it using Adobe Animate CC 2017. This clip has buttons that rotate in a circle.

Example: http://ift.tt/2gmDr6D

I'd like the the buttons to highlight when you roll over and for the clip to stop rotating. But I can't get it work on just MouseOver (eiffel tower, example)

var frequency = 3;
stage.enableMouseOver(frequency);
this.eiffel_tower.addEventListener("mouseover", fl_MouseOverHandler_4);

function fl_MouseOverHandler_4()
{
        
        this.parent.stop();

}

It works just fine on MouseClick (big ben, example).

this.big_ben.addEventListener("click", fl_MouseClickHandler_4.bind(this));

function fl_MouseClickHandler_4()
{
        this.parent.stop();
}

It works on MouseOver if I add code to trigger an alert box (state of liberty, example). But it breaks again if I delete the alert box code.

var frequency = 3;
stage.enableMouseOver(frequency);
this.stat_of_lib.addEventListener("mouseover", fl_MouseOverHandler_5);

function fl_MouseOverHandler_5()
{
        
        alert("Moused over");
        this.parent.stop();
}

I haven't worked in actionscript in a long time. What am I doing wrong? How can I get the buttons to stop the clips rotation when you rollover?

Thanks in advance for your help! I'm pulling out my hair over here.

Aucun commentaire:

Enregistrer un commentaire