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

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

6.
Type the following ActionScript after the code you added in step 3:
rotateClip.loadMovie("http://www.helpexamples.com/flash/images/
image1.jpg");
This code loads an image into the rotateClip movie clip that you created with code. You're
targeting the rotateClip instance with ActionScript.
7.
Select Control > Test Movie to test your document.
Now you should see an image on the Stage that rotates 50º clockwise.
You can also target or identify parts of SWF files that you load into a base SWF file.
To identify a loaded SWF file:
Use
, where
_levelX
loaded the SWF file.
For example, a SWF file loaded into level 99 has the target path
following example, you load a SWF file into level 99 and set its visibility to
//Load the SWF onto level 99.
loadMovieNum("contents.swf", 99);
//Set the visibility of level 99 to false.
loaderClip.onEnterFrame = function(){
_level99._visible = false;
};
It's generally a good idea to avoid using levels if you can load content into movie clips
at different depths instead. Using the
enables you to create new movie clip instances on the Stage dynamically without
having to check whether there is already an instance at a particular depth.
Setting variables using a path
You can set variables for instances that you nest inside of other instances. For example, if you
want to set a variable for a form that's inside another form, you can use the following code.
The instance submitBtn is inside of
this.formClip.submitBtn.mouseOver = true;
You can express a method or property of a particular object (such as a movie clip or text field)
using this pattern. For example, the property of an object would be
myClip._alpha = 50;
122
Syntax and Language Fundamentals
is the level number specified in the
X
formClip
loadMovie()
MovieClip.getNextHighestDepth()
on the main timeline:
function that
. In the
_level99
:
false
method

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents