Introduction to Flash and Actionscript
S6 - AddChild
Text Using addChild
Adding Text Using addChild
Formatting the Text
Movie Clips using addChild
Adding Movie Clips using addChild
Create 3 movie clip symbols, a Circle, a Star, and a Triangle. Delete the instances from the stage.
Tutorial #2 - Change Colour
Now add a Button that removes the square
Assignment #1 - Train
your previous train assignment and save it under another name.
Create the image below using addchild. (Note: or the original image you created)
Add a formated text box with a Title
Add a border around the train
Add Buttons to your train assignment that do the following:
1. Change the colour (Hint:
use a boolean variable to keep track of the colour i.e. originalColour
= true and then an if ... else to determine when to change)
Add a Title beside/above/below each button
Assignment # 2 (Now Above and Beyond)
Create a "Choose a Shape" program. That allows the user to pick a shape and then the color of that shape and then displays the image in a box with a border and title.
Hint: Make the Shapes and Colours Buttons
Pick a Colour
Pick a Shape
There are lots of different ways to do this. You can use one scene or multiple scenes.
-it is easier if you make them choose the color first
- create buttons for each color
- create buttons for each shape
- add eventlisteners for the color buttons only
- when they choose a color buttons
create movie clips for each shape
Now create event listeners for each color button and each shape button
Note: you will need to remove movie clips before placing a new one. Create a function called removeclips() that is called on every shape button. In the function have an if for each movie clip that will remove the clip if it currently exists on the stage (yes one if for each shape)
Or you could use a reset button that clears the current image before drawing a new one.
a Background Layer using a Button
Adding a Background Layer using a Button