Question

I am making a game which is simple to control, I have made it in AS2 and there I use

if (Key.isDown(1)) {
    yspeed -= power*thrust;
}

so when user is holding the mouse click down the hero moves up, but in AS3 I can't seem to figure it out, I want to make the same game for android and iPhone so I made a new file as Android AIR and now I am programming in AS3 but I can't seem to find out how to do this, I've tried with

block.addEventListener(MouseEvent.CLICK, doSomething);
function doSomething(event:MouseEvent):void{
trace("Box has been clicked");
}

but when I go to test, and I turn on the "touch layer" noting happens, but when I turn it off and click on block is traces "Box has been clicked"

Was it helpful?

Solution

Do you set the input mode? I think this is the problem.

You can check the reference here (examples provided): http://help.adobe.com/en_US/as3/dev/WS1ca064e08d7aa93023c59dfc1257b16a3d6-7ffe.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top