ActionScript3 Examples


Drag and Drop Drag a movie clip and drop it in a new location.
ball-cursor Ball moves to click at fixed speed
ball1 Mouse click event in ActionScript3
ball2 Mouse click event in ActionScript3
ball3 Mouse click event in ActionScript3
rocket1 Rocket blasts off when you click the button


color matrix ColorMatrix is used to change from full color to gray and back over a number of frames.
flower matrix ColorMatrix is used to change from full color to gray shades
flowers Shades of a color are created using ColorTransform
flowers2 Create shades of a color using alpha value
flowers3 Create shades of a color using ColorTransform, breaks up RGB value
rgb Uses sliders to select red, green, and blue values, displays hex value of color
random Array Selects a color from an array randomly, draws a dot on click.
random Pastel Selects a random pastel color, draws a dot on each frame event.


sound Play sound from the library.
sound2 Play sound from a URL.
sound3 Play sound from a channel so that you can stop and start it.


anagrams String functions find all the anagrams of a word.
animal buttons Clicking a button goes to a frame.
animals Components: Using ComboBox in ActionScript3
arrow bounce Arrow bounces off edges and turns
ball bounce Bouncing ball in ActionScript3
ballgame Mouse click event in ActionScript3
ballgame1 Mouse click event in ActionScript3
ballgame2 Ball Game 2 in ActionScript3
bass-switch Switch in ActionScript3
bounce Mouse click event in ActionScript3
boxes Boxes open and close event in ActionScript3
car A car moves across the stage and reenters from left using ActionScript
car-tree Car moves across the stage in front of a tree, then in back using ActionScript3
car0 Change properties of a movie clip using ActionScript
car1 Buttons change the speed of a car using ActionScript
car2 Car stands still, background scrolls using ActionScript
carx Car moves back and forth using ActionScript3
case Each message is shown for 40 frames using ActionScript3
combo links Combo box links to web pages
dice Roll Dice using ActionScript3

edge Is the mouse on the edge or center?
eyes Washington's eyes follow the cursor

fading Text fades in and out using ActionScript3
girl puzzle Includes actionscript file in puzzle, uses drag drop
girl puzzle2 Uses document class
gravity1 Includes class file to use gravity for more realistic animation.
gravity2 Creates the display when the user clicks stage
halloween Using the visible properties of a movie clip using ActionScript
inches Convert inches to centimeters
keys Keyboard input moves the objects as well as the buttons using ActionScript3
leaf Leaves drift randomly down using ActionScript3
loader Displays an animation while a movie is loading.
magnify Mask reveals enlarged area using ActionScript3
message A different message from an array is displayed every 50 frames.
messages A message scrolls across then changes when it reenters using an array.
Miles per gallon This could be used for many more demos.
puzzle A puzzle is scrambled, then user drags and drops pieces to solve.

sequence Clips appear in sequence using ActionScript3
shifting Balls move to back randomly using setChildIndex
sounds Sound plays from the library or from URL
talker Movie clips communicate with each other and the root.
tie Click the tie to see each frame of the tie movie click.
traffic light Light changes from red to green to yellow at intervals
yo-yo A ball bounces up and down using the sin function.


Look at these programs, then combine them all into one nice drawing program.

dots Random colored dots using ActionScript3
Drawing Dots
face Happy Face drawn at click
drawing Dots are drawn as you move the mouse in ActionScript3
pencil cursor Create a custom cursor.
draw1 Draw dots when the mouse is moved.
draw2 Draw dots when the mouse is moved ONLY IF the mouse button is down.
draw3 Draw dots
draw4 Draw dots
draw5 Draw dots

Classes: Classes to Download