Introduction to Flash and Actionscript
Text Using addChild
Adding Text Using addChild
Formatting the Text
Movie Clips using addChild
Adding Movie Clips using addChild
Create a new movie clip symbol and Export it for ActionScript. Delete it from the stage
Changing the Colour of Movie Clips
Tutorial #2 - Change Colour
Note: Use only one button library symbol and modify color etc through code.
Assignment #1 - Train
Create the image below using addchild. You may only use 4 movie clips.
Bonus ...... Create borders using code or additional objects.
Assignment # 2 (ICS3U )
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.
Assignment #2 - Modify Train (ICS3C)
(Note: You may choose to do the ICS3U assignment instead for Bonus Marks)
Add Buttons to your train assignment
1. Change the colour
Second click of the button should remove the added item.
Add a Title and a double border.
to a new layer
addChild to a new layer
backgroundLayer:Sprite=new Sprite(); ); // Do this at the beginning before adding
any other children .addChild(myBack_mc); // Then addChild onto the
); // Do this at the beginning before adding
any other children
.addChild(myBack_mc); // Then addChild onto the background layer