Hi,
last time sinious help to me.
i using that script with little changes.
if i add "Kbps" in that bandwidthHandler my tests failing.
if i remove 'Kbps' that working good.
function bandwidthHandler(e:AppEvent):void
{
downSpeeds.text = e.params.bandWidth +"Kbps";
downTest();
}
function downTest()
{
if (Number(downSpeeds.text) >= 512)
{
Pass.visible = true;
Fail.visible = false;
}
else
{
Pass.visible = false;
Fail.visible = true;
}
}
Your problem is adding a string to a number and trying to compare it as a number...
Number(downSpeeds.text) >= 512
Try passing the e.params.bandWidth as an argument to the downTest function instead of using the textfield.
function bandwidthHandler(e:AppEvent):void
{
downSpeeds.text = e.params.bandWidth +"Kbps";
downTest(e.params.bandWidth);
}
function downTest(dnSpeeds:Number)
{
if (dnSpeeds >= 512)
{
Pass.visible = true;
Fail.visible = false;
}
else
{
Pass.visible = false;
Fail.visible = true;
}
}
and one more same issue pls..
this is already string so ......
upSpeeds.text = String( int(( ( uploadFile.size/tm.currentCount ) / 1024 ) * 8 )) + " Kbps";
function uploadTest()
{
if (Number(upSpeeds.text) >= 256)
{
upPass.visible = true;
upFail.visible = false;
}
else
{
upPass.visible = false;
upFail.visible = true;
}
}
yaa i tried night, finally i got it.
Thanky you for ....
var upSpeeds:int;
upSpeeds= (( ( uploadFile.size/tm.currentCount ) / 1024 ) * 8 );
function uploadTest()
{
upSpeeds.text = upSpeeds + " Kbps";
if (Number(upSpeeds) >= 256)
{
upPass.visible = true;
upFail.visible = false;
}
else
{
upPass.visible = false;
upFail.visible = true;
}
}
North America
Europe, Middle East and Africa
Asia Pacific