0

Hi this code is working well on moving symbol(classic tween)

var frequency = 3;
stage.enableMouseOver(frequency);
this.movieClip_1.addEventListener("mouseover", fl_MouseOverHandler_9);

function fl_MouseOverHandler_9()
{
    alert("Moused over");
  // this.gotoAndStop(41);
}

but if i replaced with this.gotoAndStop(41); it does not work

1 Answers1

0

the event-target is accessible (will be passed within the event-handler-parameter-object) like this:

this.movieClip_1.addEventListener("mouseover", fl_MouseOverHandler_9);

then in the handler function:

function fl_MouseOverHandler_9(evt)
{
  // "evt.currentTarget" represents the event-trigger
   evt.currentTarget.gotoAndStop(41);
}

or you can pass the scope of the desired MC to the event handler:

this.movieClip_1.addEventListener("mouseover", fl_MouseOverHandler_9.bind(this.movieClip_1));

then in the handler function:

    function fl_MouseOverHandler_9(evt)
    {
      // "evt.currentTarget" still represents the event-trigger
      // evt.currentTarget.gotoAndStop(41);

      //but now you can access the referenced scope with "this"

      this.gotoAndStop(41);



    }

cheers mike

Mike B.
  • 16
  • 4