Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-09-2010, 12:39 PM   #1
Registered User
Join Date: Nov 2010
Location: Karachi, Pakistan
Posts: 2
Question [AS3] How to replace(swap) movieclips?

Hi, I'm trying to learn a bit more about game making and I am making a simple survival type side scrolling shooting game.

What I have done is character movement, playing the animation of him walking when you press the side arrows, and making him flip the other way when you press the opposite direction your going....

What I would like to know is how to swap the original movie clip of him, with a movie clip of him ducking when you press down, and if you hold down and direction keys(left and right), then it plays the movie clip of him walking in the crouched position...

So basically i would like to replace the movie clip with another movie clip from the LIBRARY(I know how to export on to the stage from library) into the position where the previous movie clip was, and the old movie clip of him standing goes away, when you let go of down, he stands back up.

Code and explantion please, thank you.
IronHawke is offline   Reply With Quote
Old 11-09-2010, 01:16 PM   #2
Registered User
Join Date: Nov 2010
Location: Orlando, FL
Posts: 3
Send a message via MSN to tBrock3

Did you try removeChild for the walking mc and addChild for the crouched?
tBrock3 is offline   Reply With Quote
Old 11-09-2010, 04:11 PM   #3
Registered User
Join Date: Nov 2010
Location: Karachi, Pakistan
Posts: 2

I have tried addChild, but I want it to be positioned where the standing movie clip was, just so you know,

The running movie clip is called player_mc, which consists of movie clips of his legs running(his legs are a movie clip), arms that give the running effect and the head for breathing, this player_mc movie clip is on the stage,

Q1.Should I export player_mc from the library too?

Q2.I want the crouching movie clip to be in the exact position of the player_mc, how?

Q3.Do I have to addChild to the stage or movie clip?

thx, hoping for a reply soon -

Last edited by IronHawke; 11-10-2010 at 08:23 AM.
IronHawke is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 12:23 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.