I would like to load the content of a texte file (i.e : value.txt)
in a Array.
I use :
onClipEvent (load) {
_global.testLoad = new Array()
gStartFrame = _root._currentFrame;
_global.valueSon = new LoadVars();
valueSon.load(“value.txt”);
valueSon.onLoad = function (etat) {
if (etat) { testLoad = valueSon.contenu ;
}
// trace(testLoad);
}
trace(testLoad);
}
there is a another code below this one , where i want to get the value of testLoad to use it.
but I can’t get the value in the second trace !!
i known that the variable is declare in function (so as, local) but i can find how to get the content of testLoad in the second trace, to use it later on in script.
Someone can help me ?
Thank
Here is the full code that i want to use.
it is for synchronise a mouth with the value of sound ( in level)
that doesn’t work as indicated below.
onClipEvent (load) {
_global.testLoad = new Array()
gStartFrame = _root._currentFrame;
_global.valueSon = new LoadVars();
valueSon.load(“value.txt”);
testLoad.push(valueSon.contenu);
valueSon.onLoad = function(etat) {
if (etat) {
for (var vars in this) {
if (typeof this[vars] == “string”) {
testLoad.push(this[vars]);
}
}
}
};
// trace(testLoad);
trace(testLoad);
}
onClipEvent (enterFrame) {
gFrame = _root._currentframe-gStartFrame;
gAmp = testLoad[gFrame]; // <= here it doesn’t work
trace(testLoad); //here is work but not above gAmp
with (_root.mellisa.mouth) {
gotoAndStop(gAmp+1);
}
}