Copy link to clipboard
Copied
Hello!
Let me preface this by saying I'm not a dev by any means and I'm doing this for learning and fun. You might have to go slow with me
I'm trying to make an animation which plays when someone follows on Twitch. This is what I have so far: I've set up and subscribed to the appropriate follow webhook on Twitch. When someone follows, Twitch sends me a JSON string of the follower's details, which I use to get their profile name. I have also implemented a basic WebSocket which then relays the profile name to a terminal that is listening to the WebSocket address.
I would like to be able to setup something in Animate where, when the profile name is relayed to it, the animation plays and displays the follower's name. I'm more used to AS3/Flash but I know that support is going away so I'm trying to do this in HTML5, but I'm not sure how to actually go about creating the WebSocket in Animate and what the workflow looks like, and I can't find much documentation about this (at least, doing it in Animate). Outside of Animate, I'm using node.js.
Any help or guidance in the right direction would be much appreciated!
Thank you!
1 Correct answer
The scripting language in Animate Canvas documents is bare-metal JavaScript executing natively in the browser. So you do whatever it is you want to do however you'd do it without Animate. Unless it's some massive library of code, you're probably fine just typing it all into the actions window for a frame of your movie.
Copy link to clipboard
Copied
The scripting language in Animate Canvas documents is bare-metal JavaScript executing natively in the browser. So you do whatever it is you want to do however you'd do it without Animate. Unless it's some massive library of code, you're probably fine just typing it all into the actions window for a frame of your movie.
Copy link to clipboard
Copied
Okay, thank you! I did try this earlier but I couldn't work out how to 'require' the node module I was using ( https://www.npmjs.com/package/ws ) - is this possible?
Copy link to clipboard
Copied
Um. You might want to pay a little more attention to the bolded "Note" on that page.
Copy link to clipboard
Copied
Oops! I'm an idiot. The funny thing is I read that this morning when I was installing it.
I implemented a native WebSocket and tested it and it's now reading perfectly, so I just need to keep messing around and get it to trigger the animation Thanks for your help! I'll probably be back soon with more stupid questions.

