394
Working with Text and Strings
5.
In the HTML document, modify the code inside the
object
tag to match the following.
The code you need to add is in
boldface
.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=8,0,0,0" width="550" height="400" id="flashvars"
align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flashvars.swf" />
<param name="FlashVars" value="username=Thomas" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="flashvars.swf"
FlashVars="username=Thomas"
quality="high"
bgcolor="#ffffff" width="550" height="400" name="flashvars"
align="middle" allowScriptAccess="sameDomain" type="application/x-
shockwave-flash" pluginspage="http://www.macromedia.com/go/
getflashplayer" />
</object>
6.
Save your changes to the HTML document.
7.
Open the modified HTML in a web browser.
The SWF file displays the name “Thomas” in the dynamically created text field on
the Stage.
For information on security, see
Chapter 17, “Understanding Security.”
Using LoadVars to load and display text
You can also use the LoadVars class to load content into a SWF file, which loads text or
variables from an external file on the same server, or even content from a different server. The
next example demonstrates how to dynamically create a text field and populate it with the
contents of a remote text file.
Содержание 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...