# Nested MovieClip not swapping

**URL:** <https://forum.kirupa.com/t/nested-movieclip-not-swapping/318082>\
**Category:** flash\
**Created:** [January 10, 2011, 8:45am UTC](https://forum.kirupa.com/t/nested-movieclip-not-swapping/318082 "2011-01-10T08:45:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stphven](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@stphven](https://forum.kirupa.com/u/stphven)\
**Post date:** [January 10, 2011, 8:45am UTC](https://forum.kirupa.com/t/nested-movieclip-not-swapping/318082/1 "2011-01-10T08:45:35Z")

</div>

Hi. I’m teaching myself flash, and to that end I’m making a simple top-down shooting game. My (current) problem is this:

All of the basic enemies and allies are currently represented by a simple MovieClip consisting of a circle (the ‘body’, also used for hit detection) and a named Weapon instance. ‘Weapon’ is a class linked to another simple MovieClip. The Weapon class serves as an abstract base class for a variety of ‘real’ weapons (Rifle, Laser, etc), each of which has a matching ActionScript (3) file and MovieClip. All the weapon MovieClips are visually unique.

Ok, with me so far? Well, I want my little soldiers to be able to change weapon, so I’ve created a function “swapWeapon(newWeapon:Weapon)”. This sets the soldier’s Weapon instance to the ‘newWeapon’ variable. This is where it gets confusing: the functions and code of the new weapon (eg, bullet speed and accuracy) all transfer correctly, but the appearance remains the same (the default ‘Weapon’ MovieClip).

So what am I missing? My guess would be it’s to do with the fact that I’m swapping a MovieClip instance for different (sub-) class of MovieClip. But that’s as far as my knowledge of flash takes me ☹

So yeah, any help would be great, and thanks in advance 🙂
