Re: How do we handle keyboard and mouse events in APE

7 views
Skip to first unread message

mobiled...@gmail.com

unread,
Dec 7, 2009, 3:54:54 PM12/7/09
to Swami Charan, ape-g...@googlegroups.com
this is the fla file to try out
it would be great to share how to add mouse events like

follow mouse, mouse clicks etc

On Mon, Dec 7, 2009 at 12:54 PM, <mobiled...@gmail.com> wrote:
http://pastie.org/732431

How do we handle keyboard and mouse events in APE

this example does not work!


function onKeyDown(evt:KeyboardEvent):void
        {
 
            if (evt.keyCode == Keyboard.UP)
            {
                APEngine.addForce(new VectorForce(false,0,-1));

            }
            if (evt.keyCode == Keyboard.DOWN)
            {
           APEngine.addForce(new VectorForce(false,0,1));
            }
            if (evt.keyCode == Keyboard.RIGHT)
            {
           APEngine.addForce(new VectorForce(false,1,0));

            }
            if (evt.keyCode == Keyboard.LEFT)
            {
           APEngine.addForce(new VectorForce(false,-1,0));

            }
        }
addEventListener( 'keyDown',onKeyDown );



--
Bidegg worlds best auction site
http://bidegg.com
swamicharan_APETest.fla

mobiled...@gmail.com

unread,
Dec 7, 2009, 3:54:09 PM12/7/09
to Swami Charan, ape-g...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages