A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    2

    Unhappy simple AS3 converter not working :(

    Hi guys

    I am really stuck with this assignment i am supposed to hand in tomarrow ! so would appreciate any help.

    I have been told to make a simple converter using as3 in flash to convert kilometers to miles, even though I am kinda sure my code is correct, when i test the movie, type a random number and press enter, nothing happens

    here is the code:
    kilometers_txt.addEventListener(KeyboardEvent.KEY_ DOWN,convertKilometers);
    function convertKilometers(k:KeyboardEvent)void:{
    var kilometers:Number;
    var miles:Number;
    {
    if (k.keyCode==Keyboard.ENTER) {
    kilometers=Number(km_txt.text);
    miles=kilometers / 1.61;
    miles_txt.text=String(miles);


    }
    }
    I really reallly would appreciate any help. p.s i can even send u the .flv file
    thank you

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,770
    please don't double post
    17 Years old boy, who loves the Computer Technology

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts




Click Here to Expand Forum to Full Width


HTML5 Development Center