Skip to main content
raven+crow
Known Participant
December 11, 2023
Question

Performnance Issue with Interactive Animation

  • December 11, 2023
  • 1 reply
  • 600 views

Hi all. We've created an interactive animated infographic that's got some performance issues. It lives here:
https://lunchwithravenandcrow.com/images/ANM/LCfolder/ANM-LeadershipCycle.html

 

Essentially, clicks trigger 'go to and stop,' bringing users to one of 16 frames. All works as it should at first, but then the whole thing gets really sluggish the more you use it and eventually totally stops working.

New to Animate and wondering A) why that's happening, and B) how I can fix it. Pasting the existing code from one frame below too.

Thanks in advance, all!

code-

 

var _this = this;
/*
Clicking on the specified symbol instance executes a function.
*/
_this.LtArrow.on('click', function(){
/*
Moves the playhead to the specified frame label in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
*/
_this.gotoAndStop('St3Rest');
});


var _this = this;
/*
Clicking on the specified symbol instance executes a function.
*/
_this.RtArrow.on('click', function(){
/*
Moves the playhead to the specified frame label in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
*/
_this.gotoAndStop('St2Rest');
});


var _this = this;
/*
Clicking on the specified symbol instance executes a function.
*/
_this.StabButton.on('click', function(){
/*
Moves the playhead to the specified frame label in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
*/
_this.gotoAndStop('1Stable');
});


var _this = this;
/*
Clicking on the specified symbol instance executes a function.
*/
_this.RelButton.on('click', function(){
/*
Moves the playhead to the specified frame label in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
*/
_this.gotoAndStop('1Rel');
});


var _this = this;
/*
Clicking on the specified symbol instance executes a function.
*/
_this.OverButton.on('click', function(){
/*
Moves the playhead to the specified frame label in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
*/
_this.gotoAndStop('1Over');
});


var _this = this;
/*
Clicking on the specified symbol instance executes a function.
*/
_this.FireButton.on('click', function(){
/*
Moves the playhead to the specified frame label in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
*/
_this.gotoAndStop('1Fire');
});

 

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 11, 2023

it's slow for me at the start.  each click takes more than 1 second to show a response.

 

upload your fla to a file server and post a link here.

raven+crow
Known Participant
December 11, 2023
kglad
Community Expert
Community Expert
December 12, 2023

you're adding more and more listeners to the same object when you change frames.