This will seem like a dump question, but I'm having a hard
time cracking the enigma.
Say you have a blank fla file and you add this code:
mc:MovieClip = new MovieClip();
Raises the error: Target not found: Target="undefined"
The error happens because there isn't yet a MovieClip on the
main timeline... so can mc become part of the timeline after being
declared in this way?
Ofcourse you can use
1); but I'm inquiring about something along the lines of
Overall the only use for MovieClip variables when declared in
AS seems to be to reference existing movie clips or ones made with
the attachMovie function. The variable itself doesn't seem to be
able to become part of the timeline.
I guess what I'm also trying to figure out is how to share 1
movie clip instance across several other movie clip instances.
Is it possible to make properties shared? For example say you
have a class that extends the movie clip class, it has the _alpha
property. Can that property be static, so all instances of that
class will be affected?
No, you can't use the constructor function. You can only
create movieclip instances with attachMovie, duplicateMovieClip or
When you extend the movieclip class there is a one-to-one
relationship between a movieclip in the library and a AS2 class (a
single movieclip symbol is associated with a single movieclip
subclass). You can attach that class to other mc's in your library
too so eventhough the visual appearance is different, the objects
can share the same behaviour.