This is not really about actionscript but still it's a good step in learning Flash.
What are symbols?
There are three kinds of symbols :
- Movie clips : They are animations with their own timelines and properties. They can be controlled with Actionscript. When you play a game, mostly everything you see that isn't static is a movie clip. If you pause the movie, the movie clips will continue to animate.
- Buttons : We use them when we want to give user choices or when we want the user to affect the movie. The most common usages of buttons are the play and replay buttons.
- Graphics : They are like movie clips but you can't control them with Actionscript. They are mostly used for motion tweens and such. They will play and pause with the movie.
Creating symbols
There are two ways to create symbols :
- New symbol (Ctrl + F8) : Choose new symbol from the insert menu. From the pop up, give it a name and choose its behavior (movie clip, button or graphic).
- Convert to symbol (F8) : Select something you've drawn and hit F8. The same pop up will appear but something new is there : registration. This tells flash where on your shape he must assign the center of the symbol.
Note
All the symbols you create are listed in the Library (Ctrl + L). When you click and drag a symbol from the library to the frame, it'll create an instance of it. If you double click an instance, you'll be able to edit the symbol and all its instances.
Now you know what symbols are. But how can we use them?
Movie clips
Probably the most used form of symbols, the movie clips can be controlled with Actionscript and will keep looping unless you stop them with a stop() action. They are useful when you want to animate looping things such as rain, waterfalls or wheels spinning.
Buttons
Very useful for games, in places where the user has to make choices. Also used a lot for play buttons. When you edit a button, you will see there are 4 different frames : Up, Over, Down and Hit. Up is the frame that will be shown when the button is inactive, Over is the frame for mouse contact and Down is the frame for when you click the button. The Hit frame is what has to be touched with the mouse for the button to be active.
Graphics
Graphics are useful when you want to use the same drawing a lot of times without affecting the movie filesize too much.
Symbols color
When you click a symbol and you open up the properties panel, you'll notice a Color drop-down menu with None as value. The other choices are :
- Brightness : Makes the symbol more white or black.
- Tint : Makes the symbol a certain color.
- Alpha : Makes the symbol transparent.
- Advanced : Lets you mix tint and alpha.
Basic buttons scripts
Here are three scripts you can use on buttons to control your movie. To use them, click on your button (on the frame, not in the library) and open the actions panel (F9). Then, paste one of these codes :
Play :
on(release){
play()
}
Stop :
on(release){
stop()
}
Go to scene named INTRO :
on(release){
gotoAndPlay("INTRO", 1)
}
Finally, a few links for more information :
http://www.smartwebby.com/Flash/flash_symbols.asp
http://web.image.ufl.edu/help/flash/symbols/
http://www.awdsf.com/courseware/flash/flash1_symbol_library.htm
http://www.webwasp.co.uk/tutorials/ANI---01-symbols/default.php
If you have any questions, feel free to ask here.