Image tag (<img>)
The
tag lets you embed external JPEG files, SWF files, and movie clips inside text fields.
<img>
Text automatically flows around images you embed in text fields. This tag is supported only in
dynamic and input text fields that are multiline and wrap their text.
To create a multiline text field with word wrapping, do one of the following:
•
In the Flash authoring environment, select a text field on the Stage and then, in the Property
inspector, select Multiline from the Text Type pop-up menu.
•
For a text field created at runtime with
instance's
TextField.multiline
The
tag has one required attribute,
<img>
or the linkage identifier of a movie clip symbol. All other attributes are optional.
The
tags supports the following attributes:
<img>
•
Specifies the URL to a JPEG or SWF file, or the linkage identifier for a movie clip
src
symbol in the library. This attribute is required; all other attributes are optional. External files
(JPEG and SWF files) are not displayed until they have downloaded completely.
Note: Flash Player does not support progressive JPEG files.
•
Specifies the name for the movie clip instance (created by Flash Player) that contains the
id
embedded JPEG file, SWF file, or movie clip. This is useful if you want to control the
embedded content with ActionScript.
•
The width of the image, SWF file, or movie clip, in pixels.
width
•
The height of the image, SWF file, or movie clip being inserted, in pixels.
height
•
Specifies the horizontal alignment of the embedded image within the text field. Valid
align
value are
and
left
•
Specifies the amount of horizontal space that surrounds the image where no text will
hspace
appear. The default value is 8.
•
Specifies the amount of vertical space that surrounds the image where no text will
vspace
appear. The default value is 8.
For more information and examples of using the
and movie clips in text fields" on page
Italic tag (<i>)
The
tag displays the tagged text in italics. An italic typeface must be available for the
<i>
font used.
That is very <i>interesting</i>.
The above code would render as follows:
That is very interesting.
MovieClip.createTextField()
and
TextField.wordWrap
src
. The default value is
right
152.
properties to
, which specifies the path to a JPEG file, a SWF file,
.
left
tag, see
"Embedding images, SWF files,
<img>
Using HTML-formatted text
, set the new text field
.
true
149
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?