Hi K1ngr4t,
try set a trace in your switch statement, since the Away call seams
correct.
also make sure that when you load the md2, all the prefixes are set
properly, they appear into the debug/trace window
the trace should look like
[up0]
[up1]
[up2]
[down0]
[down1]
[down2]
prefix[digit]
prefix == the animation sequence refferer
digit, frame index
if no or incorrect trace is displayed into the debug/trace window,
means the md2 is not defined as it should
also make sure yopu do not use the md2still class.
you do not provide a bit more of your code
but it should look like this:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keypressed);
private function keypressed(e:KeyboardEvent)
switch(e.keycode){
case 16:
...
Fabrice
On Dec 15, 2009, at 7:40 AM, K1ngR4T wrote:
Hi all
I have an md2 model, very simple for test purposes. It has 4 animation
sequences embedded, "up", "down", "left" and of course "right". I
would like to be able to change between these sequences when the user
presses the corresponding arrow keys on the keyboard. Could somebody
please refer me to a code example or even please just put together a
simple example for me as i am really stuck.
I am using a switch statement for the inputs using something like
this :
case Keyboard.LEFT :
animTest.play(new
AnimationSequence("left", true, true, 8));
break;
etc. for each key. This does not work, any help would be greatly
appreciated. I do have scene.updateTime(); in my render loop so that
can't be the problem. When I try run the file I get an access of
undefined property error for animTest.
Thanks a million :)