# Dynamically Adding MovieClip

**URL:** https://forum.kirupa.com/t/dynamically-adding-movieclip/261074
**Category:** flash
**Created:** [May 22, 2008, 9:04pm UTC](https://forum.kirupa.com/t/dynamically-adding-movieclip/261074 "2008-05-22T21:04:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![riveroaks](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@riveroaks](https://forum.kirupa.com/u/riveroaks)
#### Post date: [May 22, 2008, 9:04pm UTC](https://forum.kirupa.com/t/dynamically-adding-movieclip/261074/1 "2008-05-22T21:04:43Z")

</div>

I have a MovieClip in my library which is defined as a class that I have in an external actionscript file. That is, I have a MovieClip “mc\_PortfolioElement” in my library and the linkage properties have “class: PortfolioElement”. This PortfolioElement is an AS class that I have defined.

My publish settings have classes exported in Frame 2, but when I tell my MovieClip not to export in the 1st frame it does not show anything when I create a new object of its type. Then when I check “Export in first frame” it shows up when I create a new object of type PortfolioElement.

The only code that is relevant to this is:

```auto

var element = new PortfolioElement();
addChild(element);

```

How can I have the MovieClip export on a frame other than frame 1 and still display itself? Or it would even be great to know why it is NOT displaying itself when I tell it not to export in frame 1…do I need to manually load it in?
