• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[INTERACTIVICTY] Mouse Over and Out Repeatedly Triggering Issue

New Here ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

Hi All,

I am facing with some basic issue by mouse over and out event on my animaton. Here I have added my work files: https://www.dropbox.com/sh/t4x5dejodjwrhfj/AADPc2X1ShsIL27jls7JByFha?dl=0

 

My issue is that "mouse over" and "mouse out" script work more than one altgouh the crusor doesn't leave composition. 

When I move crusor a little bit on the composition, out and over scripts were triggerred again and again. 

 

Is there anyone who faced same issue and solved it?

 

TOPICS
Code , How to

Views

415

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

LATEST

Hi.

 

It's because the shape of your animation changes in each frame which affects the mouse cursor hit detection. You need to place a fixed round shape on top of everything (for example a Button instance with a circle in the hit frame).

 

Also, it seems to me you don't need a main timeline with more than one frame. But if you really need more frames, make sure to run a check so you won't add the same type of listener to the same instance multiple times. Like this:

 

 

 

if (_this.frame0Started)
{
    _this.yourInstance.on("click", _this.yourEventHandler);
    _this.frame0Started = true;
}

 

 

 

 

I hope this helps.

 

 

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines