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 clip’s
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.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...