EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 365

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 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...
Adding parameters to dynamically created movie clips 365
6. Select Edit > Edit Document to return to the main Timeline.
7. Select the movie clip symbol in the library, and select Linkage from the Library pop-up
menu.
The Linkage Properties dialog box appears.
8. Select the Export for ActionScript option, and Export in first frame.
9. Type dynamic_id into the Indentifier text box, and click OK.
10. Select the first frame of the main Timeline, and add the following code to the Actions
panel’s Script pane:
/* Attaches a new movie clip and moves it to an x and y coordinate of 50
*/
this.attachMovie("dynamic_id", "newClip_mc", 99, {name_str:"Erick",
_x:50, _y:50});
11.
Test the Flash document(Control > Test Movie).
The name you specified in the
attachMovie() call appears inside the new movie clips
text field.
You can find a sample photo gallery application on your hard disk.This file provides an
example of how to use ActionScript to control movie clips dynamically while loading image
files into a SWF file, which includes creating movie clips at runtime. You can find the sample
source file, gallery_tween.fla, in the Samples folder on your hard disk.
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\Galleries.
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/Galleries.
For an example source file that creates and removes numerous movie clips at runtime, you can
find a sample source file, animation.fla, in the Samples folder on your hard disk
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\Animation.
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/Animation.

Table of Contents

Related product manuals