Skip to main content
Participating Frequently
Sep 11, 2022 8:15 PM UTC
Question

same code, buttons failed to work after a few successes

Hello everyone, im new to animate and i am trying to make a simple html5 canveas-based interactive animation with mainly navigation buttons. 

 

I use the gotoandplay/stop code from the code snippets a lot to build the buttons, they worked pretty well for the first few buttons, but i just couldn't make them work when i try to build more of them. Considering the numbers of the repeating codes I use, and the simple change I made (just changed the frame number as the instruction says), I think it would not make many sense to the post the whole codes here. 

 

Google console gives me error report when i publish the animation, of which i think might be helpful to post them below:

Uncaught TypeError: Cannot read properties of undefined (reading 'addEventListener')
at lib.weneedtotalkaboutlynchsyndrome.frame_53 (index.js?1662924142788:3129:17)
at d._runActionsRange (createjs.min.js:19:7215)
at b._runActions (createjs.min.js:19:3229)
at b._runActionsRange (createjs.min.js:19:10055)
at b._runActions (createjs.min.js:19:3229)
at b.setPosition (createjs.min.js:19:1519)
at c._updateTimeline (createjs.min.js:14:29260)
at c.advance (createjs.min.js:14:28504)
at c._tick (createjs.min.js:14:28796)
at b._tick (createjs.min.js:13:11081)

 

I have taken advice from the other answers from the community to make a few changes to the settings (for example disable the advance layer), but it sadly didn't fix the problem. 

 

I feel like it wouldn't be a really complicated problem as i only use the basic code from code snippets, but i just couldn't figure it out for days. could anyone help me with this... 😭 (i hope my description makes sense, but please let me know if there are details that i didn't make clear). Thank you in advance!

This topic is closed to new replies. Start a new post to keep the conversation going.

10 replies

mercedesc43970157
Participating Frequently
Sep 15, 2022 1:24 PM UTC

Same problem here. I think it's an update bug, because my file worked perfectly last week and today it gives me errors without having made any changes! a real headache...

Translate
4736leahAuthor
Participating Frequently
Oct 26, 2022 11:08 PM UTC

i rebuilt the whole thing with easier structure, now its working. god i hate it.

Translate
kglad
Community Expert
Community Expert
Oct 26, 2022 11:16 PM UTC

learn how to debug.

 

lesson 1 - https://youtu.be/PBDQN9CQSeI

 

lesson 2 - https://youtu.be/KJEl0OenGUY

Translate
kglad
Community Expert
Community Expert
Sep 12, 2022 1:48 PM UTC

line 17 of index.js has an undefined object.  fix that.

 

if you don't understand that, copy and paste line 17 here.

Translate
4736leahAuthor
Participating Frequently
Sep 12, 2022 2:09 PM UTC

Hello Kglad, thank you very much for your reply! I really don't understand it... , here's line 17 of index.js:
{name:"index_atlas_7", frames: [[0,0,1026,1090]]},

 

My laptop automatically opened the index.js file in R, R gives blue round "i" icon for the lines afterwards saying "['index_atlas_7'] is better written in dot notation." I don't what does it mean either, but thought that might help?

 

R also gives many error reports in yellow rectangle, I've attached the screenshot below. I don't understand why it could go wrong... since I didn't write single line of codes but just add code snippets and wizard from the software.......

Translate
kglad
Community Expert
Community Expert
Sep 15, 2022 3:02 PM UTC

oops, my error.  

 

that's line 3129 (17th space). paste line 3129.

 

and there are no errors in the screenshot you showed (though i have no idea what "R" means).

Translate