Skip to main content
TheOriginalGC
Community Expert
June 23, 2022
Answered

Help with publishing html JS

  • June 23, 2022
  • 1 reply
  • 379 views

I just followed @Nick Gioia tutorial for making a simple JS game for HTML5 in AN. The problem is that while it works fine in AN, when I publish to HTML5, there are errors that's getting in the way of interactivity. Specifically, the objects that have addEventListener on them do not respond to user input. The errors that I'm getting point to the code that AN has added to make it palatable to HTML5. Anyone have experience with publishing AN to HTML5 that can point me to a useful tutorial?

This topic has been closed for replies.
Correct answer kglad

This is what I'm seeing. 


i'm sorry, i misread your message about opening locally.  yes, that IS the problem and that's why you're seeing a cross-domain security error.

 

ie, there's no problem in your files.  the problem is the way you're testing.

1 reply

kglad
Community Expert
June 23, 2022

are you testing from within animate (control>test movie>in browser) or have you uploaded your files to a server. (ie, you're NOT opening the html on your local file system)?

 

if so, embed a screenshot of the admin console error message.

TheOriginalGC
Community Expert
June 23, 2022

When I test in Animate with ctrl+enter, everything works fine. I haven't tried it on a server, just opening it locally. Is that the problem?

kglad
Community Expert
June 23, 2022

Roger that.


it's a browser security issue that (imo) shouldn't occur when testing locally.  (and again, sorry about that misread on my part.)