Saturday, February 14, 2009

Flash movies

Flash movies
A movie clip is a symbol which (generally speaking) resides in the library, with one or more instances of it on stage.
The content in a movie clip can be anything from a single shape in a single frame to multiple layers containing content (often including other movie clips) changing over many frames.
Additional important things to remember about movie clips:
• Every movie clip instance has its own timeline, its own playhead, and its own functions and variables.
• Every movie clip instance also has its own name, which may be assigned by you in the properties panel, or will be assigned by Flash otherwise. If you want to control a movie clip instance with action script, you need to give it an instance name.
• The main timeline of a Flash movie can also be treated as a movie clip instance (and controlled in the same way as a movie clip instance, with some exceptions). Its name is _root. It can also be accessed with the name _parent by a movie clip sitting in one of its frames.
_root is an absolute address; it always refers to the main timeline of the movie. _parent is a relative address; it is a way of addressing a movie clip's containing movie clip (timeline), regardless of where they both fall in the overall hierarchy of movie clips in the movie. A relative address is always preferable because of its flexibility. Even if the published movie is subsequently loaded into a movie clip in another movie (eg, for preloading purposes), all relative (_parent-based) addresses remain valid, but _root is no longer the same.
• When a movie clip instance is encountered in the frame of a timeline (ie, when the playhead gets to a frame holding a movie clip instance), the movie clip's playhead will begin playing immediately and will continue to play unless told to do otherwise, or unless the playhead of the timeline it's in reaches a frame where the movie clip doesn't exist. Ideally, a movie clip is placed in a single frame of a timeline, or in a frame which has a stop action in it (in another layer named 'actions'). The stop action stops the main movie, but the playhead of the movie clip continues to play.
• A movie clip always runs at the same frame rate as the main timeline.
Here is a list of properties of movie clips that you can alter with action script.
Property Discription
_alpha transparency (100=opaque, 50 = 50% translucent, 0=invisible)
_x horizontal pixel position of the movie clip's registration point, within the movie clip's containing timeline (0=left edge, 5 = 5 pixels to the right of the container's left edge, -10 = 10 pixels to the left of the container's left edge)
_y vertical pixel position of the movie clip's registration point, within the movie clip's containing timeline (0=top, 5 = 5 pixels down from the top of the container)
_xscale movie clip's width, as a percentage of its actual width (eg, set to 25 to make movie clip one quarter the width it was when first placed on stage). Scaling is done relative to clip's registration point
_yscale movie clip's height, as a percentage of its actual height (eg, set to 50 to make movie clip half as tall as it was when first placed on stage). Scaling is done relative to clip's registration point
_visible movie clip's visibility (true = showing, false = hidden)
_rotation movie clip's rotation around its registration point, in degrees clockwise, relative to its original orientation.
(color) there is no property for changing the color, but you can set the color by creating a color object for the movie clip and using setRGB to set the clip's color
The next property in the table is not settable, but is useful for finding out what frame of the movie clip the play head is currently in
_currentframe not settable, but can be read to see what frame the movie clip's play head is in

No comments: