• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

problem

Engaged ,
May 24, 2012 May 24, 2012

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;

          }

}

TOPICS
ActionScript

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 24, 2012 May 24, 2012

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

...

Votes

Translate

Translate
LEGEND ,
May 24, 2012 May 24, 2012

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;
          }
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 24, 2012 May 24, 2012

Copy link to clipboard

Copied

yes

working. Thank you Ned Murphy

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 24, 2012 May 24, 2012

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;

          }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 24, 2012 May 24, 2012

Copy link to clipboard

Copied

Show you learned something from the other and solve it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 24, 2012 May 24, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 24, 2012 May 24, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 25, 2012 May 25, 2012

Copy link to clipboard

Copied

LATEST

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;

          }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines