# Duplicating a MovieClip from an external SWF without explicit linkage

**URL:** https://forum.kirupa.com/t/duplicating-a-movieclip-from-an-external-swf-without-explicit-linkage/305936
**Category:** flash
**Created:** [March 5, 2010, 8:40pm UTC](https://forum.kirupa.com/t/duplicating-a-movieclip-from-an-external-swf-without-explicit-linkage/305936 "2010-03-05T20:40:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Unicoder](https://avatars.discourse-cdn.com/v4/letter/u/ec9cab/32.png) [@Unicoder](https://forum.kirupa.com/u/Unicoder)
#### Post date: [March 5, 2010, 8:40pm UTC](https://forum.kirupa.com/t/duplicating-a-movieclip-from-an-external-swf-without-explicit-linkage/305936/1 "2010-03-05T20:40:13Z")

</div>

In Flash CS3 I was able to duplicate any MovieClip from an external SWF by loading the SWF, and then executing the following code:

var targetClass:Class = MovieClipToDuplicate.constructor;  
var duplicate:MovieClip = new targetClass();

Note that the MovieClips I was duplicating did NOT have any linkage explicitly defined. Flash would automatically assign a unique class to each MovieClip.

Now, in Flash CS4, when I try to do the same thing the .constructor property returns only the “MovieClip” class, such that the “duplicate” variable above is but a blank MovieClip.

If I compile the external SWF using CS3, my old code still works. But I want to do it in CS4.

If anyone can tell me a definitive solution, I will be extremely impressed!
