No announcement yet.

Flash for RRFusion Volts output

  • Filter
  • Time
  • Show
Clear All
new posts

  • Flash for RRFusion Volts output

    I'm reading in the RRFusion plugin. It's working great! but I can't seem to get the volts needle to stop on the correct number.
    I'm not sure it's seeing the int. for the if's... can someone tell me if this should work? I think it is close but may not be...

    Somebody? Anybody?

    tmpstr = _root.ANALOG1;

    //used to remove the V at the end of the numbers from tmpstr
    volt_tmp = tmpstr.slice(0, length(tmpstr)-1);

    //This reads in the volts but if I try to do this:
    // It's not working correctly...

    if (volt_tmp>1){gotoAndStop("1");}
    if (volt_tmp>2){gotoAndStop("2");}
    if (volt_tmp>3){gotoAndStop("3");}
    if (volt_tmp>4){gotoAndStop("4");}
    if (volt_tmp>5){gotoAndStop("5");}
    if (volt_tmp>6){gotoAndStop("6");}
    if (volt_tmp>7){gotoAndStop("7");}
    if (volt_tmp>8){gotoAndStop("8");}
    if (volt_tmp>9){gotoAndStop("9");}

    //and so on up to 16+ volts

    How can you tell if your getting and Int value to run the if off of?
    I'm getting out put for it just fine... The textbox on my flash outputs reads (2.34) as example.

    Thanks for the help..

  • #2
    I got it... I had to work a little math in there... It appears to function correct now and I got rid of all them If's clean code will run better...

    Here is what I used....

    volt_tmp1 = Math.round(volt_tmp / 2) * 2
    gotoAndStop("" + volt_tmp1);


    • #3
      glad to hear you got it working Senior Tech Blogger (Want a product reviewed? Contact me.)
      Follow Me on Twitter or Facebook
      Live mp3Car Facebook Chat