| Welcome to Brackenwood. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Attack Button; How do I do this? | |
|---|---|
| Tweet Topic Started: Mar 24 2006, 03:00 AM (195 Views) | |
| boundless | Mar 24 2006, 03:00 AM Post #1 |
|
stuck in the third dimension
|
I was just wondering if there was a way to do this. Basically all I need is for the 'a' key to begin the attack animation and make it so that any key that is pressed during the attack, wont do anything (including the 'a' itself). As something extra (I dont know how it would be done) if you continue to hold 'a' through the attack animation, it wont continue to attack until you let go of the key and press it again. Thank you guys so much for always lending a helping hand. I wouldn't even be as far as I am without you. Even with animation, brackenwood has really helped me develop my skills. Thanks again. |
![]() |
|
| Mr. Jiggmin | Mar 24 2006, 05:14 AM Post #2 |
|
made of tulips
|
Put something like this on the main timeline:
Then put this on the first frame of the attack animation.
Hope that helps ya. |
![]() |
|
| boundless | Mar 24 2006, 06:17 AM Post #3 |
|
stuck in the third dimension
|
Hmm I'm having some trouble with this. Is it compatible with Flash MX (not 2004)? I tried replacing attackAnim.play(); with _root.box_mc.gotoAndStop(6); because the character has the instance name box_mc and the attack animation is on the 6th frame of box_mc. That didn't work so I tried putting the code on box_mc rather than the main timeline only because all the code for the character is on box_mc. I then put if (Key.isDown(Key.LEFT) && attacking == false && keyReleased == true) { on the other actions (walk left in that example). But all it did was stop those buttons from functioning. If it's for a different version of actionscript, then I'm sure all it needs is a little tweaking but I wouldn't know what to fix. Thanks for the help mr jiggmin
|
![]() |
|
| Mr. Jiggmin | Mar 25 2006, 03:40 AM Post #4 |
|
made of tulips
|
Righto, you'll need to take the ":Boolean"s out of the code. That'll probably fix the other buttons as well...
You'll need to move that code in the attack animation to the last frame, too.
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Actionscript · Next Topic » |






5:11 AM Jul 12