
#Flash actionscript 3.0 code for buttons movie
This will instruct Flash to go to the end of the movie (frame 30) and display the frame preceding the last frame displayed (starting at 30) every time a new frame is displayed (at the frame rate in frames per second specified in the "fps" text box in the Timeline panel).ĪddEventListener(Event. Click your mouse button and type in the code below. Position your mouse cursor on the first line of the Actions editor. Press the "F9" key on your keyboard to open the Actions editor and write the reverse frames AS3 code in Frame 1. Position your mouse cursor over "Frame 1," then click your left mouse button to select Frame 1. Insert the following line of ActionScript code inside it (it is a single line of code if your browser window is not wide enough, you may see it split into two lines): this.createEmptyMovieClip('myButton1', this. 3 Open the Actions panel by selecting Window > Actions. Continue drawing rectangles on each frame in different positions until you have reached frame 20. This is where all the ActionScript code will be situated. Click "Frame 2" on the timeline and draw another rectangle, but at a different position on the stage. Release the left mouse button to set the size of the rectangle. Position your mouse cursor over the stage, then click and drag your mouse to draw a rectangle.

Press the "R" key on your keyboard to activate the rectangle drawing tool. Position your mouse cursor over "Frame 1" in the timeline and click your left mouse button to select it. Tiny circles will be placed in each frame to signify that the frame is a blank keyframe. Continually press the "F6" key until 30 keyframes have been inserted on the timeline. Press the "F6" key on your keyboard to insert a keyframe on the timeline. Start the Flash program and select "Flash File(ActionScript 3.0)" from the splash screen to allow AS3 code to be used to build your movie.Ĭlick the "Timeline" option from the "Window" menu to display the timeline.
