[code]stage.addEventListener(MouseEvent.MOUSE_DOWN,doClick);
stage.addEventListener(MouseEvent.MOUSE_UP,doClick2);
addEventListener(Event.ENTER_FRAME,doE);
var clicked:Boolean = false;
var vx:Number = 0;
var ax:Number = .2;
function doClick(e:MouseEvent):void
{
clicked = true;
}
function doClick2(e:MouseEvent):void
{
clicked = false;
}
function doE(e:Event):void
{
test.x = mouseX;
if (! clicked)
{
vx += ax;
test.y += vx;
}
else
{
vx -= ax;
test.y += vx;
}
}[/code]