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

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

4.
Save the document and select Control > Test Movie to test the document.
The upper text field should have a sentence of text and most likely an error message in the
Output panel saying that Flash was unable to locate a file named beach.gif in the current
directory. The lower text field should have a sentence of text and an image of a flower that
was loaded from the remote server.
Copy a GIF image to the same directory as the FLA and rename the image to beach.gif
and select Control > Test Movie to retest the Flash document.
When using absolute URLs, you must make sure that your URL is prefixed with
.
http://
Embedding movie clip symbols
To embed a movie clip symbol in a text field, you specify the symbol's linkage identifier for
the
tag's
attribute. (For information on defining a linkage identifier, see
<img>
src
a movie clip symbol to the Stage" on page
For example, the following code inserts a movie clip symbol with the linkage identifier
into a dynamic text field with the instance name
symbol_ID
To embed a movie clip into a text field:
1.
Create a new Flash document and save it as embeddedmc.fla.
2.
Draw a new shape on the Stage, or select File > Import > Import to Stage and select an
image that is roughly 100 pixels wide by 100 pixels high.
3.
Convert the shape or image imported in the previous step by selecting it on the Stage and
pressing F8 to open the Convert to Symbol dialog box.
4.
Set the behavior to Movie Clip and enter a descriptive symbol name. Select the upper-left
square of the registration point grid, and click Advanced to switch to advanced mode if you
haven't already done so.
5.
Select the Export of ActionScript and Export in First Frame check boxes.
6.
Enter the linkage identifier img_id in the Identifier text box and then click OK.
7.
Add the following ActionScript to Frame 1 of the main Timeline:
this.createTextField("textField_txt", 10, 0, 0, 300, 200);
textField_txt.html = true;
textField_txt.htmlText = "<p>Here's a movie clip symbol:<img
src='img_id'>";
For an embedded movie clip to be displayed properly and completely, the registration
point for its symbol should be at point (0,0).
8.
Save your changes to the Flash document.
446
Working with Text and Strings
362.)
textField_txt
"Attaching
.

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