Introduction to Flash and Actionscript

S6 - AddChild

 

Tutorial 1

Adding Text Using addChild

Formatting the Text

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

ICS3C - Open your previous train assignment and save it under another name.
Delete all of you previous layers, do not delete your library symbols.

ICS3U - Create the Image below using addchild

Create the image below using addchild. (Note: or ICS3C the original image you created)

Add a formated text box with a Title

Add a border around the train

 

Modify Train

Add Buttons to your train assignment that do the following:
(Note: Second click of the button should remove/reset the added item. )

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)
2. Add a face in the window (Hint: use contains to determine whether to add or remove)
3. Add a background (individual items or see layer info below)
4. Two additional buttons that modify the picture in some way.
5. Add Steam to the Stack using circles

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

 

 

 

Your Image

There are lots of different ways to do this. You can use one scene or multiple scenes.

Hints:

-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.


Formating Fonts

 

Adding a Background Layer using a Button

Rubric