Movie Clips: The Object Overview Flash

Flash 5’s implementation of ActionScript mirrors true objectoriented programming languages. Much like JavaScript, each element in a Flash movie has a data type. A data type is simply a category to which an element belongs. According to the Flash 5 documentation, there are five data types available: Boolean, number, string, object, and Movie Clip. For our purposes, the Movie Clip is an object, and we’ll refer to it as such throughout the remainder of the book. An object is any element in Flash 5 that has changeable and accessible characteristics through ActionScript. Objects can be user-defined (you create and name them) or predefined by the programming language. The Movie Clip Object is a predefined object, meaning that all of its characteristics are already described in the ActionScript language.

A Movie Clip Object is the same Movie Clip instance we’ve seen previously. Any instance of a Movie Clip is a unique object in ActionScript. However, we haven’t treated it like an object in our scripting. Before we can proceed with a discussion of Movie Clips as Flash movie assets, you need to understand what predefined characteristics are available in the Movie Clip Object. See below for more information.

An overview of the Movie Clip Object

An overview of the Movie Clip Object

Movie Clip properties
Each Movie Clip instance has definable properties, or attributes, that control its appearance, size, and position. For example, you can move a Movie Clip instance to a new position on the Stage by changing the value of its X or Y coordinate. This property in ActionScript is denoted as _x or _y, respectively. Some properties have values that are read-only, meaning that these values can’t be altered. One read-only property is _url, the value of which indicates the download location of the Movie Clip (or .SWF file).

All properties are preceded by the underscore ( _ ) character. In Table below, each property has an “R” (as in “read”) and/or “W” (as in “write”) designation. All properties can be read, which means that you can retrieve that property’s current value. In Flash 4, these properties were retrieved using the getProperty action. The values of some properties can also be changed, through ActionScript. The table represents these properties with the “W” designation.

Properties of the Movie Clip Object

Properties of the Movie Clip Object

Flash movie and movie clip properties

Flash movie and movie clip propertiesFlash movie and movie clip propertiesFlash movie and movie clip properties

Movie Clip methods
Although the name might sound intimidating, don’t be scared. Methods are simply actions that are attached to objects. As you well know, Movie Clips qualify as objects in Flash. A method looks like a regular action except that it doesn’t (and in most cases, can’t) operate without a Dots notation reference to a target or an object:

As actions, interactive commands are executed from the timeline on which they are written. As methods, interactive commands are tied to specific (or dynamic) targets.Lists the methods and below reviews every method associated with the Movie Clip Object shows below. Some methods can be used with Movie Clip instances and with the entire Flash movie (_root, _level0, and so on), while others can only be used with Movie Clip instances. The “Flash 4” column indicates if the method (when used as an action) is compatible in the Flash 4 Player. Some commands need to be written in Dots notation, as a method (designated as “M” in the table) of a timeline or Movie Clip Object. Other commands can be used as actions (designed as “A” in the table), meaning that the Movie Clip Object name need not precede the command.

Methods of the Movie Clip Object

Methods of the Movie Clip Object

onClipEvent: The Movie Clip Object handler
Yet another exciting addition to Flash 5 ActionScript is the onClipEvent handler. In previous versions of Flash, our only event handlers were keyframes and Button instances. Now, we can add Actions to the wrapper of a Movie Clip instance meaning that these actions are not added to keyframes on the Movie Clip’s timeline.Nine events can be used with the onClipEvent handler. For a summary of these events see below.

Flash movie and movie clip methods

Flash movie and movie clip methodsFlash movie and movie clip methodsFlash movie and movie clip methodsFlash movie and movie clip methodsFlash movie and movie clip methods

OnclipEvent Handler for movie clip objects

OnclipEvent Handler for movie clip objectsOnclipEvent Handler for movie clip objectsOnclipEvent Handler for movie clip objects

Other objects that can use the Movie Clip Object
Movie Clips can be used with other ActionScript objects to control appearance and sounds, and to manipulate data.

Color Object
This object requires a Movie Clip as a target. After a new object is created with the Color() action, you can control the color effects of the targeted Movie Clip.

Sound Object
With this object, you can create virtual sound instances on a Movie Clip timeline, and target them for later use.

Mouse Object
This object controls the appearance of the mouse pointer within the Flash movie Stage. After the Mouse Object is hidden, you can attach a Movie Clip Object to the X and Y coordinates of the mouse pointer.

XML Object
If you’re working with XML (Extensible Markup Language) data from a server-side script or file, then you can store the output within a Movie Clip instance for better data management.

Related functions that target the Movie Clip Object
Some ActionScript functions work directly with Movie Clip instances for printing and targeting. Refer below for a summary of these functions.

Related functions with a movie clip target

Related functions with a movie clip target



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Flash Topics