Compiling and exporting classes
281
2.
Rename the default layer to
content
, drag a ProgressBar component from the Components
panel to the Stage, and give it an instance name of
my_pb
.
3.
Create a new layer, drag it above the content layer, and rename it
actions
.
4.
Add the following ActionScript code to Frame 1 of the actions layer on the main Timeline:
my_pb.indeterminate = true;
5.
Create a new keyframe on Frame 2 of the actions layer and add the following ActionScript
code:
var classesFrame:Number = 10;
if (_framesloaded < classesFrame) {
trace(this.getBytesLoaded() + " of " + this.getBytesTotal() + " bytes
loaded");
gotoAndPlay(1);
} else {
gotoAndStop(classesFrame);
}
6.
Create a new keyframe on Frame 10 of the actions layer and add the following
ActionScript:
stop();
7.
Create a new keyframe on Frame 10 of the content layer and drag several components onto
the Stage.
8.
Right-click each component (except the ProgressBar) in the Library panel and select
Linkage from the context menu to launch the Linkage Properties dialog box.
9.
In the Linkage Properties dialog box, make sure that Export for ActionScript is selected,
deselect the Export in First Frame check box, and click OK.
10.
Select File > Publish Settings.
11.
In the Publish Settings dialog box, select the Flash tab.
12.
Click the Settings button next to the ActionScript version pop-up menu to open the
ActionScript Settings dialog box.
13.
In the Export Frame for Classes text box, enter the number of the frame where you want
to export your class code (Frame 10).
If the frame specified does not exist in the timeline, you get an error message when you
publish your SWF file.
14.
Click OK to close the ActionScript Settings dialog box, and then click OK to close the
Publish Settings dialog box.
Summary of Contents for FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Page 1: ...Learning ActionScript 2 0 in Flash...
Page 8: ...8 Contents...
Page 18: ...18 Introduction...
Page 30: ...30 What s New in Flash 8 ActionScript...
Page 66: ...66 Writing and Editing ActionScript 2 0...
Page 328: ...328 Interfaces...
Page 350: ...350 Handling Events...
Page 590: ...590 Creating Interaction with ActionScript...
Page 710: ...710 Understanding Security...
Page 730: ...730 Debugging Applications...
Page 780: ...780 Deprecated Flash 4 operators...
Page 830: ...830 Index...