all groups > flash actionscript > may 2006 >
You're in the

flash actionscript

group:

Confused about dynamic text, paths and referencing HTML pages


Confused about dynamic text, paths and referencing HTML pages TPK
5/20/2006 8:35:01 PM
flash actionscript: Confused about dynamic text, paths and referencing HTML pages

I have a web page that has a Flash file that uses dynamic text generated from
an external file. I want to keep all the Flash files in a separate directory so
that I can access them from different HTML pages.
I am a bit confused as to how to structure the path information within the
Flash element.

My Flash uses this actionscript code:

var myCSS:TextField.StyleSheet = new TextField.StyleSheet();
myCSS.load("../css/flash.css");
index_txt.styleSheet = myCSS;

index_txt.multiline = true;
index_txt.wordWrap = true;
index_txt.html = true;

var myText:XML = new XML();
myText.ignoreWhite = true;
myText.load("../_flash/Flash_Text.html");
myText.onLoad = function()
{
index_txt.htmlText = myText;
}

The page that currently uses the flash is in this directory: (but there will
likely be others in the future)
Root -> site ->flash_page.html
The page containing the text that is pulled is:
Root -> site -> flash -> Flash_Text.html

When developing the Flash file the dynamic text appears fine when tested
through the Flash application. When I test the page (in Dreamweaver) either on
my local machine or on the remote server it fails. The page does contain the
other visual elements of the Flash file, just not the dynamic text, so I know
the HTML page is properly accessing the swf file.

I suspect I need to use _root in the actionscript to make my path information
for myText.load play well with different HTML pages, but I am not sure how to
use it.

I haven?t found any documents that explain if I should use literal paths or
virtual paths and whether the path information contained should be to the
location where the Flash file is stored or the page it is being called from.

Can anyone shed any light on the rules for file paths within a Flash file? Or
better yet, suggest an article or document that would explain it?

Thank you,

TPK
Re: Confused about dynamic text, paths and referencing HTML pages ActionScripter1
5/21/2006 4:55:52 AM
var myText:XML = new XML();
myText.ignoreWhite = true;
myText.load("../_flash/Flash_Text.html");
myText.onLoad = function()
{
index_txt.htmlText = myText;
}



////////////////////////////////////////////////////////////////////////////////
var myText:XML = new XML();
myText.ignoreWhite = true;
myText.load("flash/Flash_Text.html");
myText.onLoad = function()
{
index_txt.htmlText = myText;
}

AddThis Social Bookmark Button