PDA

View Full Version : Transform MC to another MC?


oscardog
04-06-2009, 11:55 AM
So i have a movieClip called "spaceShip" which is its normal state. When they pickup a lil powerup they get a shield so i have a MC(with linkage) called "spaceShipShielded". I have tried google but it just gave some matrix thing which looked complex and not what i wanted...

So how do i do this, other than removing a movieclip and attaching a new one, as that sounds illogical to me as there must be a function for it!

Thanks!

kkbbcute
04-06-2009, 12:08 PM
Why even have two seperate MCs, nest two animations into the same MC, that makes life a whole lot easier for you too!

oscardog
04-06-2009, 12:22 PM
Nesting two MCs? What? XD

kkbbcute
04-06-2009, 12:30 PM
Have one main MC that houses both of your different graphics on seperate frames.;)

oscardog
04-06-2009, 02:05 PM
Oh so like on the second frame have the second sprite. Then when a hittest is detected between the shield and the ship, something like "spaceShip.gotoAndStop(2);" or...?

kkbbcute
04-06-2009, 03:30 PM
Yup, something like that, and on frame 2, remember to put another MC that is your new graphic.

Enjoy, good luck!:)

oscardog
04-07-2009, 11:02 AM
Uhm this isnt working... I double click on the ship but then i cant replace the ship with the MC i want :(

bluemagica
04-07-2009, 11:29 AM
1) Drag the 1st ship mc on stage, select the mc, and press F8.
2) Put a name in the in the dialog box to create it into a mc!
3) Now double click the mc on stage!
4) On the Timeline, right click frame 2, and create blank keyframe.
5) drag the second ship mc on stage.
6) double click outside the stage!

oscardog
04-07-2009, 12:18 PM
Thanks alot, it worked, although i just broke apart the original MC, added the shield, then converted etc :)

kkbbcute
04-07-2009, 12:27 PM
Actually, for the step on creating a blank keyframe, you could just create a new keyframe and swap the symbol, amking things simpler. Alternatively, if you didn't have an MC previously, you could just duplicate the MC on stage in your new keyframe and edit that one there by placing the shield you wanted. I find it more convinient that way.

bluemagica
04-07-2009, 12:33 PM
There are many shortcuts for this! But since he is just learning, it is better to do it the long way for him, to understand it!

I normally just put all mc together on stage, make them into a single clip, select a timeline range and press f7, then just delete the clips! To me this is the easiest way, especially for many mcs, and you can turn on onion skin for better editing!

PS: keep in mind, this is not the OOP way, and real coders will probably kill us if they saw us suggesting this!

kkbbcute
04-07-2009, 12:48 PM
We are pragmatic people, what's OOP? *sarcasm* :p