In this repo I've added the code for the "Spin the bottle" subgame. It's fairly well commented and demonstrates how a subgame can be coded.
The HTML5 canvas javascript library used by all interactive subgames
This file is output by Adobe Animate's HTML5 Canvas publishing feature. It simply provides the graphic assets used in the subgames. In this case just the bottle object.
This file is where the subgame is written in an IIFE. Follow along with the comments. You'll need to get learn about CreateJS