I haven’t looked at the rest of the code, only the loadVariables part. Are you sure the path to your textfile is correct ? Because it might work offline because the path offline is correct, but online it has to be correct too. Also, I suggest you use the loadVars object instead of loadVariables:
lv = new loadVars();
lv.onLoad = function(){
for(all in this){
trace(this[all])
}
// Use this.message for example to target a variable from the textfile
}
lv.load("http://www.server.com/file.txt");
After fight with the code a while, I have this an still only works
on my pc…
Also I’m looking at some method to get if load has finished, and
then continue
// set variable to get load, the path is relative so I think is OK ??
var arctexto = _global.str+_global.num+".txt";
loadText = new loadVars();
loadText.load(arctexto);
trace(arctexto)
loadText.onLoad = function(success) {
if (success) {
// trace(success);
presentitulo.html = true;
presentitulo.htmlText = this.titulo;
}
};
could you give a trick about “get if loaded really”?
thanks a lot
To see if it’s loaded, you can check if loadText.getBytesTotal() is not zero. Try changing your relative path to an absolute path, so not folder/file.txt, but http://www.server.com/folder/file.txt
Don’t ask me why, but now is working OK
Only I have done now are:
1- Delete all files in my web site
2- Upload again
3- Before Run, close all FLA ¿?
again, thanks
— ActionScript working finally :))
function LeeTexto() {
// ESTA VARIABLE INDICA EL ARCHIVO A SEGUIR Y ES RUTA RELATIVA
arctexto = _global.str+_global.num+".txt";
// CREAMOS UN OBJETO LOADVARS
loadText = new loadVars();
// MIRAMOS SI HAY CARGA CORRECTA, SI ES ASI; ASIGNAMOS LAS VARIABLES
// REQUERIDAS, INCLUSO LA GLOBAL QUE SE USA EN TEXTOS.SWF
loadText.onLoad = function(success) {
if (success) {
// trace(success);
presentitulo.html = true;
presentitulo.htmlText = this.titulo;
_global.relato = this.variable;
}
};
// CARGAMOS EL ARCHIVO DE TEXTO
loadText.load(arctexto);
}