well, this is weird because it works if i put the data in the field myself but when I retrieve the data from the server it does not work right. I made a new .fla with just the code I'm trying to get to work. It's attached. I'm perplexed
thanks for trying. someone told me that when retrieving data from external text file, flash makes it a string . So i need to convert it to number somehow, i guess. but i just can't get it...
someone helped me from another board. here is the fix:
"getMinorVersion(...) takes your string data from text fields and convert them to ints, so you can then compare "apples to apples" (ints againts ints, like 0 againts 1 read from "3.00" and "3.01"),"
Code:
//
function getMajorVersion(aVersion:String):Number {
var majVersion:Number = parseInt(aVersion.substr(0, aVersion.indexOf(".")));
return majVersion;
}
function getMinorVersion(aVersion:String):Number {
var minVersion:Number = parseInt(aVersion.substr(aVersion.indexOf(".")+1));
return minVersion;
}
//
var myversion:Number = getMinorVersion(_root.updates.myversion.text);
var currentversion:Number = getMinorVersion(_root.updates.currentversion.text);
trace(myversion);
trace(currentversion);
if (myversion>=currentversion) {
trace("up to date");
downloadlink.gotoAndStop(3);
} else if (myversion<currentversion) {
trace("update required");
downloadlink.gotoAndStop(2);
}