Copy link to clipboard
Copied
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 = fal
Copy link to clipboard
Copied
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;
}
}
Copy link to clipboard
Copied
yes
working. Thank you Ned Murphy
Copy link to clipboard
Copied
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;
}
}
Copy link to clipboard
Copied
Show you learned something from the other and solve it.
Copy link to clipboard
Copied
no, no
first i trying after i asking for solution. this is already i tried the as last time but not working.
Copy link to clipboard
Copied
no, no
this involves solving the same problem so you should learn from the first one and apply it to the second. If you tried, you should show what you tried.
Copy link to clipboard
Copied
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;
}
}