Contents |
|
Adding Audio | Capturing the Keyboard |
This tutorial assumes you have a basic understanding of this software.
This tutorial shows three ways JavaScript can be used to add more complexity to your movies. Create a new movie. Add a 'Button' and a 'Text Box'.
Change the 'Script ID' of the 'Text Box' to 'Text1'.
In the movie properties add the following script to the 'General' script. The 'General' script is for adding variable declarations and functions that can be used from anywhere within the movie.
In the button properties add the following script to the 'On Click' script.
Click 'Play' to test the movie. Every time the button is pressed, the value of Counter is increased and a message is show in the text box.
![]() | Play |
The movie includes and 'On Update' event which is called every time the movie is updated, which could be many times a second.
Start a new movie and add a 'Text Box'.
Change the 'Script ID' of the 'Text Box' to 'Text1'.
Add the following script to the movie 'On Update' script event.
Click play and the 'Text Box' will be constantly updated with the time and date.
![]() | Play |
Start a new movie and recreate the circle animation from the 'Getting Started' tutorial.
Turn off 'Loop' in the movie properties.
Add the following script to the movie 'General' script. This creates and new counter variable.
Add the following script to the movie 'On End' script event.
Click 'Play' to test the movie. The animation will play 3 times before stopping.
![]() | Play |
Adding Audio | Capturing the Keyboard |