Highlighted

[INTERACTIVICTY] Mouse Over and Out Repeatedly Triggering Issue

New Here ,
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

329

Likes

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

[INTERACTIVICTY] Mouse Over and Out Repeatedly Triggering Issue

New Here ,
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

330

Likes

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
May 05, 2020 0
Adobe Community Professional ,
May 05, 2020

Copy link to clipboard

Copied

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

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
May 05, 2020 0