MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 76

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

//display the label
welcome_lbl.visible = true;
}
};
submit_button.addEventListener("click", btnListener);
For more information, see
operators" on page
194.
MovieClip data type
Movie clips are symbols that can play animation in a Flash application. They are the only data
type that refers to a graphic element. The MovieClip data type lets you control movie clip
symbols using the methods of the MovieClip class.
You do not use a constructor to call the methods of the MovieClip class. You can create a
movie clip instance on the Stage or create an instance dynamically. Then you simply call the
methods of the MovieClip class using the dot (
Working with movie clips on the Stage
methods for different movie clip instances that are on the Stage:
getURL()
my_mc.startDrag(true);
parent_mc.getURL("http://www.macromedia.com/support/" + product);
The second example returns the width of a movie clip called
instance must be a movie clip, and the returned value must be a numeric value.
function getMCWidth(target_mc:MovieClip):Number {
return target_mc._width;
}
trace(getMCWidth(my_mc));
Creating movie clips dynamically
useful when you want to avoid manually creating movie clips on the Stage or attaching them
from the library. For example, you might create an image gallery with a large number of
thumbnail images that you want to organize on the Stage. Using
MovieClip.createEmptyMovieClip()
ActionScript.
To dynamically create a movie clip, use
the following example:
// Creates a movie clip to hold the container.
this.createEmptyMovieClip("image_mc", 9);
// Loads an image into image_mc.
image_mc.loadMovie("http://www.helpexamples.com/flash/images/image1.jpg");
76
Data and Data Types
"Using functions in Flash" on page 214
.
The following example calls the
Using ActionScript to create movie clips dynamically is
lets you create an application entirely using
MovieClip.createEmptyMovieClip()
and
) operator.
on the Stage. The targeted
my_mc
"About logical
and
startDrag()
, as shown in

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents