Line 16 happened before mytext.txt was loaded, you have to trace line 16 after the text file is loaded.
download v3 (swish)PHP Code:onSelfEvent (load) {
var n:Number=0;//Declare n outside of the function. = _root.n
loadV = new LoadVars();
MyArray = new Array();
loadV.load("mytext.txt");
loadV.onData = function(s) {
p = s.split('&');
for(i=1; i < p.length; i++) {
MyArray[i]=p[i].split('|');
}
n = parseFloat(MyArray[1][0]);
_root.main.n =n
trace(_root.main.n)// here true value
ready();//Call ready after the loaded text file loop.
}
function ready(){//Check _root.main.n after text file is loaded
trace(_root.main.n)
}
}




Reply With Quote