Flash CS3 Documentation |
|||
| Learning ActionScript 2.0 in Adobe Flash > Working with Text and Strings > About loading text and variables into text fields > Using FlashVars to load and display text | |||
Using FlashVars is simple, but requires you to publish your SWF files along with HTML documents. You modify the generated HTML code and include the FlashVars properties in both the object and embed tags. You can then test the Flash document by viewing the modified HTML document in your web browser.
this.createTextField("my_txt", 10, 10, 10, 100, 21);
my_txt.text = _level0.username;
|
NOTE |
|
An HTML document publishes, by default, to the same directory as your FLA file. If an HTML document does not publish, select File > Publish Settings and then select the Formats tab. Make sure that you select HTML. |
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.adobe.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.adobe.com/go/getflashplayer" /> </object>
The SWF file displays the name "Thomas" in the dynamically created text field on the Stage.
For information on security, see Understanding Security.
Flash CS3
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000887.html
Comments
No screen name said on Jul 18, 2007 at 6:41 PM : bclover said on Oct 17, 2007 at 9:30 AM : No screen name said on Mar 5, 2008 at 5:06 AM : Ivan Stimac said on Mar 9, 2008 at 11:19 AM :