project 1 Actionscript

  

   The very first line of script is called the “stop action” and it does just what it says; it stops the animation from playing. Usually before the stop action this code is entered:

                  “ import flash.events.* ”

What this would do is import all the events so you don’t have to use the longer names. It just makes things a little easier, however for some reason my animation works fine without this piece of code, and actually malfunctions with it entered in.

   Moving on, the code on line four is setting the variable, moveForward, to a Boolean of false. A Boolean just means that something can be defined as either “true” or “false.” In this case since it is set to false, the animation will not move forward. The code in lines six through twelve are collectively an “if else” statement. Since the function defined is moveMovieClip the code is basically saying if the variable equals true, then the Heat_mc movie clip will move on to the next frame, or play forward. If the variable equals false, then the Heat_mc movie clip will move back to the previous frames, or play backwards.

   The last parts of the code are about event listeners. Line fourteen is defining the event listener for the Heat_mc movie clip, saying that it will move forward when the frame is entered by whatever we define below. In lines sixteen through nineteen we define a mouse event that utilizes the mouse over function when the variable is true, and the mouse out function when the variable is false. In other words, when you mouse over anywhere inside animation the variable will equal true and therefore the animation will play forward. If you mouse anywhere outside of the animation the variable will equal false and the animation will play backwards.