Adobe Flash AS 2.0

Asked

Viewed 19 times

0

My problem is that when the character moves diagonally, he doesn’t do the animation (which is the same as -x or x).

Here is my script:

onClipEvent (enterFrame){
    if (Key.isDown(Key.UP)){
    this.gotoAndStop(2);
}
    if (Key.isDown(Key.DOWN)){
    this.gotoAndStop(1);

}
if (Key.isDown(Key.RIGHT)){
    this.gotoAndStop(4);
}
    if (Key.isDown(Key.LEFT)){
    this.gotoAndStop(3);
}
    if (Key.isDown(Key.UP) and Key.isDown(Key.RIGHT)){
    this.gotoAndStop(2);
    _root.char.costas.nextFrame();
}
if (Key.isDown(Key.UP) and Key.isDown(Key.LEFT)){
    this.gotoAndStop(2);
    _root.char.costas.nextFrame();
    }

        if (Key.isDown(Key.DOWN) and Key.isDown(Key.RIGHT)){
    this.gotoAndStop(1);
    _root.char.frente.nextFrame();

}
        if (Key.isDown(Key.DOWN) and Key.isDown(Key.LEFT)){
    this.gotoAndStop(5); 


}
}

Please, could someone tell me what’s wrong?

  • Actually there is nothing moving there. You are changing properties of a Timeline, the correct thing would be to use the properties x and y of the content you want to move. What’s inside these frames? It is almost impossible to detect what is occurring in your file without understanding the graphical part.

  • my problem is only the animation n works

  • already checked the instance of the moveclips if it is all right? It seems that it just does not animate when you press two keys at the same time

  • obg but I do not send pictures because I have no sophisticate reputation..

  • I’ve checked it all out

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.