Highlighted

HTML5 canvas mouse roll over problem

New Here ,
Jun 22, 2020

Copy link to clipboard

Copied

Hi guys new to Animate so please bare with me.

 

I am looking to create a trigger when rolled over to play an impoted GIF sequence, which works fine in ActionScript but cannot work out where I am going wrong in HTML5.

 

I have created the sequence code below which works fine 'on click' .

However, instead of 'on click' I need it to function 'on mouse over'

I have been searching YouTube and on here for over 3 hours and my brain is about to explode.

 

Any help would be much appreciated.


/* Stop at This Frame
The timeline will stop/pause at the frame where you insert this code.
Can also be used to stop/pause the timeline of movieclips.
*/

this.stop();

 

/* Click to Go to Frame and Play
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and continues playback from that frame.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
2.Frame numbers in EaselJS start at 0 instead of 1
*/

this.movieClip_1.addEventListener("click", fl_ClickToGoToAndPlayFromFrame.bind(this));

function fl_ClickToGoToAndPlayFromFrame()
{
this.gotoAndPlay(2);
}

 

Views

50

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

HTML5 canvas mouse roll over problem

New Here ,
Jun 22, 2020

Copy link to clipboard

Copied

Hi guys new to Animate so please bare with me.

 

I am looking to create a trigger when rolled over to play an impoted GIF sequence, which works fine in ActionScript but cannot work out where I am going wrong in HTML5.

 

I have created the sequence code below which works fine 'on click' .

However, instead of 'on click' I need it to function 'on mouse over'

I have been searching YouTube and on here for over 3 hours and my brain is about to explode.

 

Any help would be much appreciated.


/* Stop at This Frame
The timeline will stop/pause at the frame where you insert this code.
Can also be used to stop/pause the timeline of movieclips.
*/

this.stop();

 

/* Click to Go to Frame and Play
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and continues playback from that frame.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
2.Frame numbers in EaselJS start at 0 instead of 1
*/

this.movieClip_1.addEventListener("click", fl_ClickToGoToAndPlayFromFrame.bind(this));

function fl_ClickToGoToAndPlayFromFrame()
{
this.gotoAndPlay(2);
}

 

Views

51

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
Jun 22, 2020 0
Adobe Community Professional ,
Jun 23, 2020

Copy link to clipboard

Copied

stage.enableMouseOver();

 

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

 

function overF(){

this.gotoAndPlay("wherever");

}

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...
Jun 23, 2020 0
New Here ,
Jun 23, 2020

Copy link to clipboard

Copied

Thank you so much! 

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...
Jun 23, 2020 0
kglad LATEST
Adobe Community Professional ,
Jun 23, 2020

Copy link to clipboard

Copied

you're welcome.

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...
Jun 23, 2020 0