Introduction to Flash and Actionscript

S4 - Buttons, Keyboard Commands, and HitTest

A1 - Moving and Resizing



Student Example

a) Move a Symbol up and down using arrow buttons


instancename.y -=5; //moves up

instancename.y +=5; //moves down

b) Add left and right buttons

c) Resize a Symbol

Use .width and .height


d) Rotate a Symbol

Use .rotation


e) Message Box

Add a message box that explains what is happening. The message should appear when you click on the butto and disappear when you move off the button. Since the text box is not changing set the properties only once at the start of your program not in the functions



Next and Previous (Cancelled)

To move to a specific scene we use (gotoAndPlay(1, "Scene 1")) where 1 is the frame and "Scene 1" is the scene.

a) Create at least 4 additional scenes in your Assignment 1. Each scene must include buttons that modify the scene in some way. The modifications should be different on each scene. (Changes alpha, colour, background, etc. be creative and try something different)

Add Next and Previous Buttons to change between scenes.

Also add a goto beginning and goto end option on each scene




Adding Sounds to a Button

Add different sounds to your buttons

Step 1

Import your audio file into the library by selecting File > Import > Import to library then select your audio file and click ok.

Step 3

Double click on your sound button and your timeline should look like below:

Now select the down state and create a new key frame by selecting F6.

Step 4

First add your sound file to the library.

With the down state selected go to the bottom of screen and choose your audio file from the library menu.