i checking speed test. so this script showing like 504.254654 value.
but i don't want to after desimal(.) numbers.
(like 504 only)
value.text = String( ( ( file.size/myTimer.currentCount ) / 1024 ) * 8 );
Thank you for all.
and one more thing
in my function >= 256 this test pass visible upPass button. but not showing in this function. what am i worng?
function show_message(e:DataEvent)
{
tm.stop();
value.text = String( int( ( ( file.size/tm.currentCount ) / 1024 ) * 8 ) );
uploadTest();
}
function uploadTest()
{
if (Number(upSpeeds) >= 256)
{
upPass.visible = true;
}
else{
upFail.visible = false;
}
}
I think if the speed is >= 256 then you want upPass.visible = true; like you have it but if it's less then you should set upFail.visible = true;. You're currently setting its visibility to false;
Aside that, are you saying the upPass button isn't showing if the speed is greater than 256? Is the instance name (not the library name) of upPass and upFail set properly? Is the alpha also set to 1?
Can you run a trace inside that function to verify data?
e.g.:
function uploadTest()
{
trace("upSpeeds: " + upSpeeds); // see what the function sees
if (int(upSpeeds) > 256)
{
upPass.visible = true;
}
else
{
upFail.visible = true;
}
}
Typically you may see the text is correct but if the variable wasn't defined in a global scope it is not available to the function and it will trace this to output:
upSpeeds: undefined
If that's the case you know upSpeeds needs to be defined on a global level so it can be utilized in that function.
North America
Europe, Middle East and Africa
Asia Pacific