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

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

8.
Click a blank frame between Frame 1 and 20, and set the tween type to Shape in the
Property inspector.
9.
Save the current document as animation.fla.
10.
Select Control > Test Movie to preview the animation.
The SWF file is created in the same directory as the FLA. For this exercise to work
correctly, you need the SWF file to generate so that you can load it into a separate
FLA file.
11.
Create a new FLA file and save it as animationholder.fla.
Save the file in the same folder as the animation.fla file you created previously.
12.
Add the following ActionScript code to Frame 1 of the main Timeline:
this.createTextField("textField_txt", 10, 0, 0, 300, 200);
textField_txt.html = true;
textField_txt.htmlText = "Here's an interesting animation: <img
src='animation.swf' id='animation_mc'>";
In this case, the fully qualified path to the newly created movie clip is
textField_txt.animation_mc
13.
Save your changes to the Flash document and then select Control > Test Movie to preview
the animation within the text field.
To control the SWF file as it plays in a text field, complete the next exercise.
To control a SWF file that plays in a text field:
1.
Follow the steps in the first procedure under
ActionScript" on page
2.
Create a button instance on the Stage and give it the instance name stop_btn in the
Property inspector.
3.
Add the following ActionScript code beneath the existing code in Frame 1 of the
main Timeline:
stop_btn.onRelease = function() {
textField_txt.animation_mc.stop();
};
4.
Select Control > Test Movie to test the application.
Now, whenever you click the
nested within the text field stops.
For information on making your embedded media into a hyperlink, see
hypertext links out of embedded media" on page
448
Working with Text and Strings
.
447.
button instance, the timeline of the animation
stop_btn
"Controlling embedded media with
449.
"About making

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