Highlighted

How to prevent this animation from looping?

Participant ,
Jul 19, 2019

Copy link to clipboard

Copied

Hi. I have the following code that I wrote with help from forum members. I'm still working the bugs out. Here is the code from Frame 1(0). One of the problems is that  when the nextBtn animates onto the screen after the video ends, it slides into the frame using a tween, and then you can hover over it and it changes colors and then you click it to advance to the next frame. However, once you hover over it if you then move off it the tween animation is re-triggered. I tried setting the properties panel from loop to only play once but it didn't help. Any ideas how I could fix this?

this.stop();

var nextBtnVAR = this.nextBtn;

var timelineVAR = this;

this.stopBtn.addEventListener("click", stopVideoFUNC.bind(this));

function stopVideoFUNC()

{

$("#video1")[0].pause();

$("#video1")[0].currentTime = 0;

this.pauseBtn.visible = false;

}

this.playBtn.addEventListener("click", playVideoFUNC.bind(this));

function playVideoFUNC()

{

$("#video1")[0].play();

this.pauseBtn.visible = true;

}

this.pauseBtn.addEventListener("click", pauseVideoFUNC.bind(this));

function pauseVideoFUNC()

{

$("#video1")[0].pause();

this.pauseBtn.visible = false;

}

this.nextBtn.addEventListener("click", nextFrameFUNC.bind(this));

function nextFrameFUNC()

{

this.gotoAndStop(2);

}

this.video1.on("added", function()

{

$("#video1")[0].addEventListener('ended', timelineVAR.endedHandler);

}

);

this.endedHandler = function(e)

{

timelineVAR.gotoAndStop(1);

timelineVAR.pauseBtn.visible = false;

};

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

you have movieclips in the over and out 'frames' of your nextBtn?

Views

294

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

How to prevent this animation from looping?

Participant ,
Jul 19, 2019

Copy link to clipboard

Copied

Hi. I have the following code that I wrote with help from forum members. I'm still working the bugs out. Here is the code from Frame 1(0). One of the problems is that  when the nextBtn animates onto the screen after the video ends, it slides into the frame using a tween, and then you can hover over it and it changes colors and then you click it to advance to the next frame. However, once you hover over it if you then move off it the tween animation is re-triggered. I tried setting the properties panel from loop to only play once but it didn't help. Any ideas how I could fix this?

this.stop();

var nextBtnVAR = this.nextBtn;

var timelineVAR = this;

this.stopBtn.addEventListener("click", stopVideoFUNC.bind(this));

function stopVideoFUNC()

{

$("#video1")[0].pause();

$("#video1")[0].currentTime = 0;

this.pauseBtn.visible = false;

}

this.playBtn.addEventListener("click", playVideoFUNC.bind(this));

function playVideoFUNC()

{

$("#video1")[0].play();

this.pauseBtn.visible = true;

}

this.pauseBtn.addEventListener("click", pauseVideoFUNC.bind(this));

function pauseVideoFUNC()

{

$("#video1")[0].pause();

this.pauseBtn.visible = false;

}

this.nextBtn.addEventListener("click", nextFrameFUNC.bind(this));

function nextFrameFUNC()

{

this.gotoAndStop(2);

}

this.video1.on("added", function()

{

$("#video1")[0].addEventListener('ended', timelineVAR.endedHandler);

}

);

this.endedHandler = function(e)

{

timelineVAR.gotoAndStop(1);

timelineVAR.pauseBtn.visible = false;

};

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

you have movieclips in the over and out 'frames' of your nextBtn?

Views

295

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
Jul 19, 2019 0
Adobe Community Professional ,
Jul 21, 2019

Copy link to clipboard

Copied

you have movieclips in the over and out 'frames' of your nextBtn?

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...
Jul 21, 2019 1
Participant ,
Jul 21, 2019

Copy link to clipboard

Copied

Yeah 'up' too. I guess I was conceptualizing this wrong.

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...
Jul 21, 2019 0
Adobe Community Professional ,
Jul 22, 2019

Copy link to clipboard

Copied

you should experiment to determine what you want to happen.  right now it's not clear what (up, over and maybe down) tween animation is occurring that you do not want.

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...
Jul 22, 2019 0
Participant ,
Jul 22, 2019

Copy link to clipboard

Copied

I fixed it. I think I was just rushing things and got confused with all the other problems. I set it up so it works properly now though.

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...
Jul 22, 2019 0
kglad LATEST
Adobe Community Professional ,
Jul 22, 2019

Copy link to clipboard

Copied

good to hear.

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...
Jul 22, 2019 0