Hi I would like to know if you can convert decimal to binary using actionscript 3.0?

Hi I would like to know if you can convert decimal to binary using actionscript 3.0?

Hi thanks for the response Ive tried to implement the code as you stated but it is not outputting please if you could check the following code and let me know where Ive gone wrong that would be much appreciated Thanks!.
miles_txt.addEventListener(KeyboardEvent.KEY_DOWN,convertKilometres);
miles_txt.restrict ="0-9";
function convertKilometres (k:KeyboardEvent):void {
var miles:Number;
var kilometres:Number;
if (k.keyCode == Keyboard.ENTER){
miles=Number(miles_txt.text);
kilometres=miles* 1.609344;
kilometres_txt.text = kilometres.toPrecision(2);
kilometreConvert_txt.addEventListener(KeyboardEvent.KEY_DOWN,convertKiloToMile);
kilometreConvert_txt.restrict = "0-9";
function convertKiloToMile(k:KeyboardEvent):void{
var kilometreConvert:Number;
var milesAnswer:Number;
if (k.keyCode==Keyboard.ENTER) {
kilometreConvert=Number(kilometreConvert_txt.text);
milesAnswer=kilometreConvert* 0.621371192;
milesAnswer_txt.text = milesAnswer.toPrecision(2);
binary_txt.addEventListener(KeyboardEvent.KEY_DOWN, checkEnterKey2);
function checkEnterKey2(e:KeyboardEvent):void{
if(binary_txt.text != '' && e.keyCode == Keyboard.ENTER){
decimal_txt.text=binaryToDecimal(binary_txt.text).toString();
function binaryToDecimal(s:String):Number{
var n:Number = 0
for(var i:int=0;i<s.length;i++){
n+=Number(s.substr(i,1))<<(s.length-1-i)
return n;
function decimalToBinary(n:Number):String{
return n.toString(2);
return_btn.addEventListener(MouseEvent.CLICK, goBackToCalculator);
function goBackToCalculator(e:Event):void
mybuttonSound.play();
gotoAndStop("Calculator");
clear_btn.addEventListener(MouseEvent.CLICK,clearField);
function clearField(e:MouseEvent):void{
  mybuttonSound.play();
  miles_txt.text ="";
  kilometres_txt.text ="";
  milesAnswer_txt.text ="";
  kilometreConvert_txt.text ="";
  binary_txt.text ="";
  decimal_txt.text ="";

Similar Messages

  • HT1918 I am receiving charges and would like to know if you can tell me what the AppleID is that is buying the songs

    I am receiving charges and would like to know if you can tell me what the AppleID is that is buying the songs

    We're just fellow users here and have no access to any information about your account. Nor in most cases will Apple be able to give you such information. If your credit card is being charged for purchases that are not showing in your iTunes Store account's Purchase History, contact your bank and report the charges as fraudulent.
    Regards.

  • I would like to know if you can ship to this adress?

    I would like to know if you can ship to this adress?

    Hi InryUrguia,
    I'm not sure which address you're inquiring about, but click here for more information about where we can ship to as well as options for international customers. 
    Let us know if you have any additional questions. Thanks!
    Elizabeth|Social Media Supervisor|Best Buy® Corporate
     Private Message

  • I just paid with my visa to increase the size of how much I can store in my iCloud from my iPhone but I'm noticing im going to have to pay the 27.99 price to get what I really want so I would like to know if you can stop that payment or put on 27.99

    I'm sorry I thought I was already doing that lol. Ok so I paid for more storage for my iCloud which was $3.99 but I'm releaizing that im going to have pay the $27.99 payment to get what I want I guess. So I would like to know if that payment can be stopped or forward to the other $27.99 payment I'll be making. I'm also not sure, but think I am lol, that if I were to pay the $27.99 if that applies to my iPhone and my iPad ? Or would that have to be two payments? Which I'm pretty sure its not but rather be safe than sorry. Thanks for your help. All i want to do is to able to store my music in iCloud so I can upgrade my phone to the new iOS 8.1.1 which I'm pretty sure I have room for but I'd rather just pay the $.399 than the $27.99 cuz. I don't need to listen to the radio lol

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • Would like to know if you can sync your iPhone to the iPad?

    I teach and my students will be using the iPads outside of my room at times and I'm tryinG to find out if there is a way to sync the iPhone up to my iPads to see what is going on?

    No

  • I would like to know if you have to back up a macbook hard drive, can I use a external hard drive that has been previously used to back up several pc 's, or is it best to have a separate external drive for the Mac?

    I would like to know if you have to back up a macbook hard drive, can I use a external hard drive that has been previously used to back up several pc 's, or is it best to have a separate external drive for the Mac?

    In the Mac side of things, backups usually come in two flavors: clones or incrementals.
    A bootable clone is a bit-for-bit copy of all essential files in the startup volume. If using the Lions, clones can be made using CarbonCopyCloner or just plain old Disk Utility. These backups represent the safest protection of your info, but take the longest to do. Recovery is an inverse process: you copy the clone back into the internal drive.
    Incremental backups start with a complete backup of the startup volume and only copy whatever changed from the previous run. OS X includes the fully integrated Time Machine backup utility to do this. It is extremely easy to do and takes the least amount of time. Recovery is another matter altogether since you have to start with a freshly installed instance of the OS and have to apply all intervening backups to bring the result to the latest saved version.
    As for where the backup takes place, the recommended media is an external dedicated drive or drives connected via the fastest interface available on your Mac: Thunderbolt, USB3, Firewire, or USB2. Network-based backups, wired or wireless, are attractive but may not offer the same performance and hence take longer. Also important to note that the entire drive need not be completely dedicated to a single backup. The Mac's EFI firmware infrastructure allows for an unlimited number of partitions on a hard drive and each can be used for either type of backups.
    Holler if you need specifics on how to do each. This was just an executive summary.

  • I would like to know if I can "join CD tracks" once they are downloaded into a playlist in my ITunes folder on my computer and/or how do you "join CD tracks" if you are downloading from iTunes itself.   I have two songs that I would like to "join" but I d

         I would like to know if I can "join CD tracks" once they are downloaded into a playlist in my ITunes folder on my computer and/or how do you "join CD tracks" if you are downloading from iTunes itself.   From the information through the "Help" menu, it seems you can only "join cd tracks" when you are in the process of downloading them from a CD onto your iTunes playlist?
    .....any suggestions would help.
    Thank You
    DW

    The help menu is correct.

  • HT4528 Good afternoon ...  I would like to know how I can do to communicate with Verizone company to see if I can unlock my iPhone 5 which acquired in NY last year, buy it because you sold me released but is totally false ...  I welcome your comments ...

    Good afternoon ...  I would like to know how I can do to communicate with Verizone company to see if I can unlock my iPhone 5 which acquired in NY last year, buy it because you sold me released but is totally false ...  I welcome your comments ...

    Krawly11 wrote:
    That's what they told me at the time of purchase and that's why the team acquired ...
    But when I get to Venezuela and introduce NANO-Sim in a line to use the phone here just does not respond to the network ... None of the 3 phone lines we handle here ...
    It is a 64G IPhone 5 ... 
    Regardless, it is not a matter of carrier locking.  Verizon iPhone 5 phones were never GSM sim-locked to begin with.  Every iPhone Verizon has sold since the introduction of the iPhone 5 has been sold with an unlocked GSM slot, as required in the USA by their agreement with the FCC.  They have not been allowed to sell any iPhone 5, iPhone 5c nor iPhone 5s devices with GSM carrier locking in place.
    Your connection problems are from some other cause - it is NOT a carrier locking issue.

  • I am a teacher of IT Information Technology for high school students of a public school in the state of Minas My Brazil, and would like to know if you guys have dreamweaver cs5 for students and flash, so I can teach students the construction of these site

    I am a teacher of IT Information Technology for high school students of a public school in the state of Minas My Brazil, and would like to know if you guys have dreamweaver cs5 for students and flash, so I can teach students the construction of these sites trough applications

    Hi,
    In addition to what Ken said, I would suggest that you give Edge Animate a shot as well.
    Creative Cloud is available as trial version for 30 days and almost all creative software is bundled with the Creative Cloud. Tutorials are included for each of the products on the respective sections of the website. For instance, this site Website builder | Download free Adobe Dreamweaver CC trial gives you access to the trial version as well as tutorials.
    I suggest that you go to http://creative.adobe.com and explore the various options available.
    For any purchase related information, feel free to send me a private message if you need further clarification. Click on my picture and use the message option. The experts on this forum can help you with other questions you have on using Creative Cloud.
    Thanks,
    Preran

  • Hello i would like to know if you have apple shop in birmigham and i want to tell me the cost of iphone 4s because here in your shop i found it 199$ and it is too cheap

    hello i would like to know if you have apple shop in birmigham and i want to tell me the cost of iphone 4s because here in your shop i found it 199$ and it is too cheap

    We're not Apple here, just your fellow users. And you can look this all up yourself:
    http://store.apple.com/uk
    http://www.apple.com/uk/retail/
    A price of $199 would be in the US and would be subsidized by the cell carrier, requiring a two-year contract with them.
    Regards.

  • HT4972 i would like to know if you have to get the latest itunes on your computer to update your ipod to the latest version?

    i would like to know if you have to get the latest itunes on your computer to update your ipod to the latest version?

    Note that the 3G iPod can only go as high as 5.1.1
    The 6G to 6.1.5
    The 5G to the current 7.0.X
    Identifying iPod models

  • I have an iphone 4 softbank carrier and would like to know if you have to unlock to use any carrier

    I have an iphone 4 softbank carrier and would like to know if you have to unlock to use any carrier

    Softbank does NOT offer unlocking.  You cannot ever use that phone on another network.  You will need to purchase a different phone if you wish to use another carrier.

  • Hello, I would like to know how I can open a file without downloading it? Thank you

    Hello, I would like to know how I can open a file without downloading it? Thank you

    matrix wrote in message
    news:[email protected]..
    > I tried that, attached is the vi.
    > My actual aim is to allow data to be plotted to the graph 4 24 hours,
    > after which, it should clear the chart and start at the beginning
    > agin.
    > Does this vi do this.
    No. The attached is the simplest way of modifying it to do as you want. I've
    sped things up a little to make it obvious.
    > Will the array be able to keep all the data, is there a way i can do
    > it without arrays, i.e. kind of dynamically, and therefore try to save
    > memory usage.
    You already are. You're making the arrays as you go along so only the memory
    needed for the data that's in the plot is in use at any one time. To do it
    without storing
    arrays at all you'd need to keep retrieving the data from
    the XYgraph, adding the new datapoint and writing it back. Messy and I
    suspect incredibly inefficient.
    You're going to use the memory in any case- a better option would be to
    pre-initialise an array and fill it slowly. At the end of each 24 hour block
    zap all the data and start again without destroying and recreating the
    arrays. Or if you're only doing the 24 hour wipes to save memory, simply
    start again at the start of the buffer woithout erasing the previous data
    and you always have 24 hours of data to liik at once the system's running.
    Do a search for keywords like "pre initialise" or "circular buffer" on
    ni.com
    [Attachment xy-time_modified.vi, see below]
    Attachments:
    xy-time_modified.vi ‏51 KB

  • I would like to know what you think about water proof cases?

    I would like to know what you think about water proof cases?

    This is a user to user forum; no fellow user can provide the information you request. I suggest that you take a look here: Have questions about your Creative Cloud or Subscription Membership?

  • Would like to know if anyone can help me.Just want to type something on my mac and then copy it on my printer.Can anyone help me Thank you

    would like to know if anyone can help me.I want to type something out on my mac book and then copy it on my printer.Thank you

    You can use Text Edit.
    Then from the Text Edit menu bar click File / Print.

Maybe you are looking for

  • LinkToAction how to use it with parameter?

    Hello, searching for tutorials about the use of the LinkToAction I have seen that here is a possiblity in WD4J to use a context-node. How can you pass a parameter in WD4A? (I am using a rowrepeater for a list of books and would like to pass the bookI

  • Pictures in iBook are partial/missing not displaying correctly

    I downloaded new iBook called "Foundation" and the pictures are incomplete/partial/missing.  Tried deleting the book and re-downloading and still same problem.   Some pictures are complete, some partial and some just have a question mark inside a blu

  • Snow leopard and cd-r issues

    I have been trying to burn some songs from iTunes to a CD-R.  I have a large pkg of these that I had no issue with before but neither my iMac or my MBP are accepting these now.  I know the drive is fine and the info is not corrupted as I burned the i

  • No Print Settings for Epson printer

    I have an Epson 1400, and it was working fine this morning. I usually go to Print Settings to select my glossy paper. But just now, when I went to print, and tried to click the Print settings... button, nothing happens. I have tried using Software Up

  • Help printing on an adobe PDF

    I am trying to print on an adobe PDF public works payroll reporting form and am unable to print.  Any suggestions?  I have adobe reader.  Jeannie