MACROMEDIA FLASH 8-FLASH Specifications Page 241

  • Download
  • Add to my manuals
  • Print
  • Page
    / 290
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 240
Play a movie clip 241
Next, you’ll specify what the function does: it plays the movie clip on
the root Timeline, which is the main timeline. In your script, you’ll
refer to the movie clip by the linkage identifier name in the Linkage
Properties dialog box (MCTrio).
Additionally, even though you didnt place an instance of the MCTrio
symbol on the Stage, you’ll use ActionScript to create an instance name
for the symbol. The instance name that you’ll specify is trio_mc.
3. With the insertion point at the end of the last line of script, press Enter
or Return. Then type the following:
this._parent.attachMovie("MCTrio", "trio_mc", 1);
The number 1 in the script that you just typed refers to the depth on
the layer in which to play the movie clip.
Every movie clip instance has its own z axis (depth) that determines the
stacking order of a movie clip within its parent SWF file or movie clip.
When you use the
attachMovie() method to create a new movie clip
at runtime, you always specify a depth for the new clip as a method
parameter.
Specify movie clip Stage coordinates
In addition to the z axis for the movie clip, you must specify the x and y
coordinates to place the movie clip within the Stage area at runtime.
Press Enter (Windows) or Return (Macintosh) after the last line in the
Script pane and type the following:
trio_mc._x = 275;
trio_mc._y = 200;
};
NOTE
For more information about the attachMovie() method, see
attachMovie() in the ActionScript 2.0 Language Reference. Additionally,
you can use the ActionScript 2.0 Language Reference for information
about ActionScript that allows you to manage depth;
getNextHighestDepth(), getDepth(), getInstanceAtDepth() are
methods of the MovieClip class. The DepthManager class allows you to
manage the relative depth assignments of a movie clip.
Page view 240
1 2 ... 236 237 238 239 240 241 242 243 244 245 246 ... 289 290

Comments to this Manuals

No comments