- Home
- Tutorials
- Flash
- Intermediate
- Actionscript and timelines

Symbol contents, components and finishing words
Henrik Andersson
I write actionscript as a hobby and have gotten very good at understanding the finer points of the language and the platform. I generally hang out on IRC and the forums if you want to discuss something.
With all this talk about how instances behave, it is now time to explore how the content of an instance works.
For a MovieClip symbol, it is fairly simple. Everything with an instance name is added to the movieclip instance's own display list. However, what is done with the actual drawn shapes? Is it added by just drawing stuff with the Graphics object associate with the timeline? No, it is added as Shape objects that are added to the display list of the movieclip.
Graphics type symbols are never a real instance on their own in the final SWF file. They are just named groups in the authoring tool. Their content is placed at each spot they appear during publishing. This explains why there are so few options available for them; they don’t have a place for those options in the swf file.
The last symbol type, buttons, is very strange. They are not obeying the normal container system at all; instead, they show one of three different states, using a fourth sate as the clickable area. This is due to how the buttons are saved in the swf file, exactly like that, four different states.
The mysteries of components
Components are mysterious things that nobody actually understands. Well, at least that's the picture most people have about them. But they are not that hard in reality. However, this is not a tutorial in how the components work. I only want to briefly mention one relevant part about them, the component properties.
The component properties can be used to set values on the component from the component inspector. This includes things like the label on buttons and so on. But how is these settings saved?
It is actually quite similar to how the frame scripts work. The compiler injects extra code at the end of the constructor and/or the frame script for the frame to set the properties at runtime. Depending on your version of Flash, it may do the setting of the properties inline or in a separate method, but the point is that it is done at the end of the constructor.
Obviously, if you try to set the properties yourself in the constructor, the values that you set will indeed be set, but only for a limited time. The injected code will blindly overwrite the values that you have set. My advice here is simple: don't set any component properties at authortime if you run into this issue.
Finishing words
In conclusion, a lot of the mysteries that makes it hard for people to work with timelines in Flash actually stem from a lack of knowledge about the topic. These topics are simple enough to explain that I managed to do it within this short text, but they are not explained anywhere else, not in the manual and not online either. By writing this text, I hope that you, the reader, will have an easy time working with Flash instead of having to figure out all of this on your own like I did.
Spread The Word
Article Series
-
Actionscript and timelines
Related Articles
5 Responses to "Actionscript and timelines" 
|
said this on 13 Nov 2009 5:05:03 AM CST
Thanx for article. Useful
|
|
said this on 20 Nov 2009 9:15:57 PM CST
You should have touched o
It was a good article |
|
said this on 21 Nov 2009 3:26:53 AM CST
dint help me with what i
thanks... |
|
said this on 03 Mar 2010 12:45:25 PM CST
Woo hoo! This article roc
|
|
said this on 07 Jul 2010 9:26:33 AM CST
Very useful article! Than
|


Author/Admin)