all groups > flash actionscript > march 2005 >
You're in the

flash actionscript

group:

.txt loads up locally, not when on the web.


.txt loads up locally, not when on the web. reggieflux
3/13/2005 7:55:23 PM
flash actionscript:
I am trying to load a .txt file into a dynamic text field in my swf. It works
fine on my local machine, but when I posted it, the text no longer shows up.
Here is the script that I used to call up the file (i need it to read html
formatting...) loadVarsText = new loadVars();
loadVarsText.load('../picts/grunebaum2.txt'); //assign a
function which fires when the data is loaded:
loadVarsText.onLoad = function (success){ if
(success){ trace ('done loading');
//Now that we know the data is loaded, //set the
text content of the Text Field //with the instance name
'scroller' equal to the //contents of the variable
right.html = true; right.htmlText =
this.var1 }else{ trace ('not loaded');
} } any suggestions.
Re: .txt loads up locally, not when on the web. kglad
3/13/2005 8:30:49 PM
try:

Re: .txt loads up locally, not when on the web. reggieflux
3/13/2005 8:39:45 PM
try:
loadVarsText = new LoadVars();

Re: .txt loads up locally, not when on the web. kglad
3/13/2005 9:06:21 PM
Re: .txt loads up locally, not when on the web. reggieflux
3/13/2005 9:25:59 PM
Thanks so much for your help, but I still get nothing. I'll just copy below
what I have as a script now, and if there is anything better/useless--let me
know. I am so frustrated. loadVarsText = new loadVars();
loadVarsText.load('../picts/grunebaum2.txt'); //assign a function which fires
when the data is loaded: loadVarsText.onLoad = function (success){ if
(success){ trace ('done loading'); //Now that we know the data is loaded, //set
the text content of the Text Field //with the instance name 'scroller' equal to
the //contents of the variable right.html = true; right.htmlText = this.var1
}else{ trace ('not loaded'); } }
Re: .txt loads up locally, not when on the web. reggieflux
3/13/2005 9:27:59 PM
oops. i mean: LoadVarsText = new LoadVars();
LoadVarsText.load('../picts/grunebaum2.txt'); //assign a function which fires
when the data is loaded: LoadVarsText.onLoad = function (success){ if
(success){ trace ('done loading'); //Now that we know the data is loaded, //set
the text content of the Text Field //with the instance name 'scroller' equal to
the //contents of the variable right.html = true; right.htmlText = this.var1
}else{ trace ('not loaded'); } }
Re: .txt loads up locally, not when on the web. turbidity
3/13/2005 10:07:38 PM
Hmm,

If it works on your machine, my guess is that it is not so much with your
code, but your addressing. Are your swf and the web page hosting it in the
exact same directory? If not, keep in mind that when the Flash piece is loaded
by the web page, the path is not figured from the URL of the SWF, but rather
from the web page.
Re: .txt loads up locally, not when on the web. kglad
3/14/2005 1:29:12 AM
Re: .txt loads up locally, not when on the web. abeall
3/14/2005 2:46:59 AM
A very common mistake(just to run it by):

AddThis Social Bookmark Button