EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Attachmovie (Movieclip.attachmovie Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
448 ActionScript classes
Example
The following code sets the
_alpha property of a dynamically created movie clip named
triangle to 50% when the mouse rolls over the movie clip. Add the following ActionScript
to your FLA or AS file:
this.createEmptyMovieClip("triangle", this.getNextHighestDepth());
triangle.beginFill(0x0000FF, 100);
triangle.moveTo(10, 10);
triangle.lineTo(10, 100);
triangle.lineTo(100, 10);
triangle.lineTo(10, 10);
triangle.onRollOver = function() {
this._alpha = 50;
};
triangle.onRollOut = function() {
this._alpha = 100;
};
See also
_alpha (Button._alpha property), _alpha (TextField._alpha property), _visible
(MovieClip._visible property)
attachMovie (MovieClip.attachMovie method)
public attachMovie(id:String, name:String, depth:Number,
[initObject:Object]) : MovieClip
Takes a symbol from the library and attaches it to the movie clip. Use
MovieClip.removeMovieClip() or MovieClip.unloadMovie() to remove a SWF file
attached with
attachMovie().
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
id:String - The linkage name of the movie clip symbol in the library to attach to a movie
clip on the Stage. This is the name entered in the Identifier field in the Linkage Properties
dialog box.
name:String - A unique instance name for the movie clip being attached to the movie clip.
depth:Number - An integer specifying the depth level where the SWF file is placed.

Table of Contents

Related product manuals