Flash Tutorial MX 2004 - Simple Links 01: Only The Timeline and Tools Are Open
Flash Tutorial MX 2004 - Simple Links 01: Only The Timeline and Tools Are Open
php
1. Go to: File > New > General Tab > Flash Document > OK
Note: The work space in Flash is often quite cluttered with Panels.
Panels are tool boxes and although useful - much of the time time you
don't need them and I think for beginners they are confusing. For this
reason we are going to close then all except for the Timeline and
Tools. You can turn these Panels off and On in the Windows Menu.
Only the Timeline and Tools are open.
Note: You should also close all the Panels that you will find in the sub
menus. The sub menus can be accessed via the little triangles:
2. We are now ready to customise the document. Go to: Modify >
Document.
3. Type in the dimensions that you want for your movie. The one above
is 200 x 130 px (pixels).
4. Select a background colour by clicking on the coloured swatch.
5. Click: OK.
6. Save your file
Your Document Properties should look
like this.
stop();
1. In the timeline, if you are not already on frame 1, drag the red Play Head to: Frame 1
2. On the stage select the: Button
3. Open the Actions Panel - on the keyboard press: F9
Important: If you have selected the button correctly the
Actions panel should say Actions - Button in the top corner:
Always check what it says in the top left corner of the Actions
Panel.
4. Type the following code into the Actions Panel:
on (release) {
gotoAndStop(2);
}
This means that when the mouse button is released you will go to frame 2 and stop.
Add the actionscript to the remaining buttons and you are home and dry. Well done. To do this go back and
repeat Step Seven. Except this time do not go to frame 1 but go to frame 2 and select first one button and then
the next.
Your actionscript will look slightly different as you the buttons will be moving you to different frames. The
actionscript that moves you from frame 2 to frame 1 will look like this:
on (release) {
gotoAndStop(1);
}
Page 4 From http://www.webwasp.co.uk/tutorials/a01-simple-links/index.php
The actionscript that moves you from frame 2 to frame 3 will look this:
on (release) {
gotoAndStop(3);
}
When you have done both of these buttons will also need to go to frame 3 and set the actionscript for that
button.
1. Go to: File > New > General Tab > Flash Document > OK
2. We are now ready to customise the document. Go to: Modify > Document.
3. Type in the dimensions that you want for your movie. The one above is: 200 x 130 px
4. Select a background colour by clicking on the coloured swatch.
5. Click: OK
6. Go to: File > Save
In Flash whenever you use an object more than once you create a symbol. This saves on download time as the
symbol downloads only once. Even though you may use it many times the original symbol is simply repeated as
many times as need be without repetitive downloads. In Flash when you animate with a technique called
tweening you must use a symbol. Tweened animation only use symbols.
1. If the Edit Bar is not open, open it: Window > ToolBars > Edit Bar
2. Go to: Insert > New Symbol
3. Give your symbol a name: Bounce Grafx
4. For behavior select: Graphic
5. Click: OK
Note: This takes you to
a new work area to
create your symbol.
This is not the main stage.
The Edit Bar enables you to see that you are working in a symbol called: Bounce Grafx.
6. Create your new symbol in this work area:
You can type a word or draw something simple. As long as you have something to animate. I used the
Text tool to type the word: Bounce
7. Once you have finished typing (or drawing) go back to the: Selection tool
8. Return to the main stage by clicking on the Scene 1 button in the Edit Bar:
Note: Scene 1 is the main stage or main work area.
Note: In the TimeLine you should now see an arrow between the two keyframes. This will have a
mauve background colour.
How a Motion Tween should look in the timeline - An arrow with mauve background.
There is no Tween here so there is no arrow or mauve background.
A broken Tween has a dotted line instead of an arrow.
Note: A Motion Tween has the same symbol in each end of the Tween or in each Keyframe. The most common
reason for a broken Tween is that there is the symbol plus an addition object in one of the Keyframes. If you
need a button or additional text or drawings these should be placed in a different Layer to the Tween. To create
a new Layer click on the Insert Layer button:
Remember: Tweens cannot be mixed with other objects.
1. If the red Play Head is not in frame 1, Click on frame 1 to place it back at the beginning of the movie.
2. Press Enter on the keyboard to test your animation.
You can change how a symbol looks in the Transform Panel. Try and change the width, height, rotation and
skew using this panel. The change will be incorporated in the animated
Motion Tween.
Properties
The Property
Inspector also enable
you to change how
your symbol looks.
You can change:
Width, height and X
Y axis (position on the stage). You can also change the colour or transparency of your symbol.
Flash Tutorial - Tweening with Motion Guides - 03 Beginners Flash Compatibility: MX 2004
Written by: Phil Length: 1400 words Assumed Knowledge : Tweening
The aim of the tutorial is to learn how to tween symbols
using motion guides. Ordinarily with a Tween an object
moves in a straight line from one point to the next. Motion
guides allow you to move an object in a curve or spiral
between one point to the next.
If the Tween is correct you have an arrow in between the two keyframes (black dots) with a blue
background.
Page 8 From http://www.webwasp.co.uk/tutorials/a01-simple-links/index.php
8. Rename Layer 1. In the Timeline double click on the words Layer 1 and type: Tween
For the moment we are done with the Tween.
1. In the Timeline
click on the
Button: Add
Motion Guide
2. If your Tools are not open, open them: Window > Tools
3. Select the: Pencil Tool
4. In the Options section at the bottom of the Tool Panel select: Smooth
Selecting the Smooth setting for the Pencil tool.
5. In the Guide
Layer select:
Frame 1 Frame
1 of the new
guide layer
selected.
6. With the Pencil
tool still
selected: Draw
a spiral
The Stage with
both Layers.
Note: Make
sure that spiral
(or any other
curve that you
want to draw)
must not cross
over itself.
7. Go to the
Selection tool:
8. Click on the
spiral line to
select it.
9. If the Property Inspector is closed, open it: Window > Property
10. The Property Inspector will now display information about the Pencil tool. If it is not
set to a line width of 1 point (or less), select: 1
Setting the Pencil tool to a Stroke Height (width) of 1 point.
11. In the Guide Layer click on the: Lock Button
The Guide Layer is padlocked.
This is done to ensure that the spiral guide drawing is not
selected by mistake.
Page 9 From http://www.webwasp.co.uk/tutorials/a01-simple-links/index.php
12. Go to: View > Snapping > Snap to Objects
Snap to Objects should be ticked:
Note: This is not essential, but it makes it easier because you
will clearly see the Spiral Symbol snap onto the guide line.
13. With the Selection Tool grab the centre point of the 'Spiral:
text and drag it onto the beginning of the spiral line. You
should see the text jump as the text symbol snaps onto the
guideline.
The Spiral text centre point snapped onto the begriming of the
guideline.
Note: It is the registration point in the centre of the symbol
which snaps to the guide. The registration point must be
directly over the top of the guideline. It is easiest to pick up the
symbol by the registration point.
14. Move the Playhead to: Frame 40
Playhead on frame 40.
15. Drag the "Spiral" text onto the end of the spiral guideline. You
should see the text jump as the text symbol snaps onto the
guideline.
Symbol snapped onto end point of guideline.
16. The Motion guide is now complete. To test the movie, on the
keyboard press: Enter
The word "Spiral" should move in around the spiral guide.
Note: The guideline will not be visible in the final published
movie. To preview what it will look like when finished goto: Control
> Test Movie
1. Right click (Mac: Ctrl click) on frame 15 and select: Insert Keyframe.
The time line should now have a arrow between frame 1 and 15.
This is the symbol for a tween. If your time line does not have an arrow, you have done something
wrong
At this stage you can either change the shape of your existing art work, or delete it and create a new
shape. I am going to do the latter.
2. Delete the word: one The word will still be in frame 1.
3. Type the word: two
4. If you wish, change its size, position, rotation or colour.
5. With the word 'two' still selected go to: Modify > Break Apart
6. Do the same thing again: Modify > Break Apart
You do not need to use shape hints and I did not use them in the movie above, but often shape tweens throw up
unexpected results. To control the way the shape changes as it moves you use shape hints.
1. Go back to frame 1
2. Go to: Modify > Shape > Add Shape Hint
This will place a disk marked with a letter: A
3. Drag this to point to a new position that you want to mark on the word: one
4. Go to the last frame of the shape tween: frame 15
The disk will already be there.
5. Drag it to mark a corresponding point on the word: two
6. Test the move to see the difference.
7. Change the position of the disks and test again.
• If you place additional disks in frame 1, they will be marked B, C, D etc. You can only have 24 disks.
• If the disks are not visible go to: View > Show Shape Hints
• It is best to place the first disk in the top left hand corner of your shape and work anti-clockwise around
the shape with subsequent disks.
For the best results try not to make the shapes too complicated. Otherwise you may get unexpected results.
Page 12 From http://www.webwasp.co.uk/tutorials/a01-simple-links/index.php
You can shape tween things you draw or type, but if they are groups, instances or text, they must be broken
apart (Modify > Break Apart). Text has to be broken apart twice! Some groups or other objects may need to be
broken apart several times. Remember if the object is not dotty, you cannot shape tween it.
The simplest thing to shape tween is something you have drawn on stage.
You can also break apart and shape tween a bitmap, but it does not work very well.
This tutorial is designed for people who have little Experience of using Flash. The aim of the tutorial is to be
able to create your own buttons, how to Align objects to the stage and create layers.
The button can change it's appearance according to what 'state' it is in. There are four states: Up, Over, Down
and Hit.
Roll your mouse over the button below and click to see the Up, Over and Down states. You can't see the Hit
area as it is invisible. The button has no actions so does not do anything.
Note: You can either have a Flash movie which contains a number of buttons or you can have a
Flash movie that is a single button and no more.
Frame 1 - Up
Frame 2 - Over
Frame 3 - Down
Frame 4 - Hit
1. In the middle of the stage draw a rectangle with the rectangle tool:
When you have finished drawing your rectangle, make sure you go back to the Selection tool:
If you do not do this you will draw more rectangles by mistake.
2. With the selection tool , single click on the rectangle fill and select any colour you may want with the
Fill Color tool:
3. You need to align your rectangle to the centre of the stage using the Align panel. Go to: Window >
Design Panels > Align (Ctrl K)
4. Double click on the coloured fill of the rectangle. This should select both the fill and the stroke (outline).
Fill and stroke highlighted: Both are dotty!
Warning: If the fill and stroke are not both highlighted you will only move part
of your rectangle. Often the stroke will get left behind, even if the stroke is white, and cannot be seen, be
careful not do to do this, as this 'debris' may cause problems latter.
1. Right click in the 'over' frame in the 'text' layer and select: Insert Keyframe
You will notice the play head has moved to the 'over' frame and your text and rectangle from frame 1 is
copied to the over frame.
2. Select the text with the Selection tool and change the text to bold by going to Text > Style > Bold
Note: Instead of changing the text to bold you could do any other change you wanted such as size,
colour or position.
3. You may need to align the text centre of the stage again.
4. Right click in the 'over' frame in the 'background' layer and select Insert Keyframe.
5. Change the rectangle to another colour by single clicking the fill colour of the rectangle (only the fill
will be dotty). Select a colour by clicking on the Fill Color tool:
1. Create a new Layer above your background layer by clicking on the Insert Layer Button:
2. Name the layer: Mask
3. Open your Library: Window > Library.
4. Drag the circle symbol
into the new mask layer.
1. Right click
(Mac: Ctrl
click) on
frame 60
of the
mask layer
and select:
Insert
Keyframe
2. Right click
on frame
30 of the
mask layer
and select:
Create Motion Tween
3. Drag the circle from the left side of the stage to the right. This will automatically place a keyframe in
frame 30.
4. If you wish use the Align panel to nudge the circle into place.
Note: The background has disappeared!
Page 17 From http://www.webwasp.co.uk/tutorials/a01-simple-links/index.php
Step six: Adding frames to the
background
Note that when you create a mask the layers become automatically locked. The lock icon appears next
to the layer labels. If you wish to edit the layers you will need to unlock the layers by clicking on the
lock icon . The mask will appear to be gone, in actual fact if you test the movie you will find it makes
no difference. To make the mask appear again (at least on stage) re-lock the layers.
See how the layers are now locked and the Layer Symbols have now changed from: to:
onClipEvent (enterFrame) {
startDrag(this, true);
}
Your script and options should look like this.
Note: All the text is in blue yours should be the same. If it is not you have made a typing error.
ActionScript Explained
onClipEvent (enterFrame) {
Do the following every time the Play Head enters the frame. This would normally be 12 times per second.
startDrag(this, true);
Start to drag this object (the circle symbol). The true centres the object to the middle of the mouse.
}
End of the clip event.
Cross Ref: You can only attach one object at a time to the mouse this way. If you wish to attach several objects
to your mouse you will need to use a different method see the Intermediate tutorial: Creating a Magnifying
Glass
2. It is probably worth saving and testing your movie at this stage: Control > Test Movie
Mouse.hide();
This hides the default mouse cursor.
5. Test your movie.
1. Simple Links
2. Animation - Tweening
The aim of the tutorial is to show you how symbols are placed within symbols. This is a fundamental concept in
Flash.
Note: In this example the word web animates independently to the opening animation. Click the play button
and watch the word web. It animates irrespective of what the word wasp does. This is little concept enables
you to do so much. It means that one object - such as an animated word (or group of objects) react in ways
which is not dependant on what other objects are doing. This gives you tremendous flexibility and fluidity when
building your Flash Movies.
Step one: Creating the first symbol In the example above my first symbol was the word web.
O
K
4. If you Library is closed, open it: Window > Library (F11)
5. Drag the first Symbol that you created into the middle of the Stage:
Note: You need to drag the Graphic Symbol not the
Movie Clip. If you drag the wrong Symbol you will get an error
message:
Error Message.
Note: You can tell a movie clip from a graphic by
the icon the Library.
Make sure you select the
Movie Graphic Graphic Symbol.
Clip
6. In the Timeline right click (Mac: Ctrl click) in frame 30 and select: Insert Keyframe
Note: This copy and pastes whatever is in frame 1 into frame 30.
7. Right click in the Timeline on
frame 1 and select: Create
Motion Tween
Your Timeline should look like
this:
The Timeline with a Motion
Tween.
8. In the Property Inspector
select: Rotate > CW (clockwise)
Making the symbol rotate.
Note: If you press Enter on your keyboard you should find that your
animation looks similar to this:
If your animation does not exactly like this it does not matter as the tutorial is
about nesting (placing one symbol inside another) not about animation
techniques. What is important is that the word web animates.
If your symbol does not rotate around the central axis but like this:
The symbol is not rotating around the centre of the word.
To correct this select the Free Transformation Tool and click on the symbol. Drag the little circle to
the centre of the symbol:
The Symbol rotates around the little circle. Move the circle and the animations central point changes.
Page 22 From http://www.webwasp.co.uk/tutorials/a01-simple-links/index.php
9. If the Edit Bar is closed, open it: Window > Toolbars > Edit Bar
10. To return to the Main Stage clicking on the Scene 1 Tab:
Note: This will take you back to the stage. Remember your animation is not on the stage but in the
Library.
11. Save your Flash Movie.
2. If the Actions Panel is closed, open it: Window > Actions (F9)
3. At the end of this animation I would like the animation to stop. To do this you will need to select the last
Keyframe in your Timeline. In mine this is frame 40. Type the following into the Actions Panel:
stop();
If you wish to test your Movie again it should now play once and then stop.
You will need a new layer for your button. If you do not do this your Tween may end up in a muddle.
on (release) {
gotoAndPlay(1);
}
Step eight: Test your movie
It is time to see if your movie works. Good Luck!
1. Save your Flash movie.
2. Go to: Control > Test Movie.