Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect output from animation to highcharts using window.message #1

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

hirokiterashima
Copy link
Member

@hirokiterashima hirokiterashima commented Nov 22, 2024

Note

No need to merge this PR, as it's only to demonstrate the changes needed to make the connection work.

Changes

This pull request includes the addition of a new HTML file, photosynthesis-chloroplast2.html, which sets up the structure and scripting for an animation and a Highcharts graph related to photosynthesis in chloroplasts. The most important changes include the initialization of the animation and Highcharts graph, handling of messages to update the graph, and the setup of the HTML structure.

Initialization and scripting:

  • Added initialization functions for the animation and Highcharts graph, including event listeners for file loading and completion, and a function to play sounds. (photosynthesis-chloroplast2.html)
  • Implemented a message event listener to update the Highcharts graph data based on received messages. (photosynthesis-chloroplast2.html)

HTML structure:

  • Created the HTML structure, including the canvas for the animation and a container for the Highcharts graph. (photosynthesis-chloroplast2.html)

Test

  1. Add ActionScript to call window.postMessage('stage[0,1,2...]') in the scene. Go to Window > Actions to bring up the ActionScript dialog.
Screenshot 2024-11-22 at 1 56 03 PM Screenshot 2024-11-22 at 1 56 11 PM
  1. Test the movie. Instead of photosynthesis-chloroplast.html, open up photosynthesis-chloroplast2.html.
  2. Play the animation. As it hits the different frames, it should fire the window.postMessage('stage[0,1,2...]'). The window in photosynthesis-chloroplast2.html listens to it, and invokes highchart to plot the graph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant