So I am trying to make a character jump using a button. I can't seem to get around this, can any 1 help plz.
I tried different ways like using a timer to make him jump up and down but got incorrect results.


Action Script 3


import fl.controls.Button;
import fl.controls.TextArea;
import fl.events.ComponentEvent;
import flash.media.Sound;
import flash.display.Sprite;

var upbtn:Button = new Button();
upbtn.autoRepeat = true;
upbtn.label = "UP";
upbtn.width = 50;
upbtn.height = 30;
upbtn.move(60, 380);
addChild(upbtn);

upbtn.addEventListener(ComponentEvent.BUTTON_DOWN, upbtnDownHandler);


function upbtnDownHandler(evt:ComponentEvent):void {
goodguy_mc.y-=3;

}