PDA

View Full Version : need help



itdo
December 18th, 2004, 10:57 AM
I need help figuring out when you press the left arrow key, the movieclip with these actions in it dissapears, puts another movieclip in its exact position, and plays the movieclip.

JoMan
December 18th, 2004, 11:04 AM
??

I don't quite know what you mean? Do you mean attaching the animations through ActionScript?

EDIT: If you mean attaching the animations from the library, just use the following:



if (Key.isDown(Key.LEFT)) {
mc.attachMovie("mc_walkLeft", "mc_walkLeft", 1); // attaches the mc's walking animation
}

But, I think that you should make a solid movieClip with the animations inside, like RyxiaN said.

RyxiaN
December 18th, 2004, 11:31 AM
do you mean when you clicks a button etc. space the mc shall change for example take up a gun... it's just adding different animations and this actionscript



Code

onClipEvent(enterFrame){
if (Key.isDown(Key.SPACE)){
gotoAndStop(frame of animation);
}
}

itdo
December 18th, 2004, 12:33 PM
That really helped, thanks!

RyxiaN
December 18th, 2004, 01:46 PM
ok.. thank you