-
-
Prid - Outing
2 errors (organized by colors):
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);
}
}
RED: What is that unnecessary bracket doing there? Remove it, lol
GREEN: It's the other way, :void
Also, instead of adding an Event Listener to your textfield, you can just add it to the stage:
Actionscript Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, convertKilometers);
Just saying
Hope this helps, though, and also that I'm not too late
I am back, guys ... and finally 18 :P
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|