# Create dynamic move clips, then set properties

**URL:** <https://forum.kirupa.com/t/create-dynamic-move-clips-then-set-properties/230980>\
**Category:** Uncategorized\
**Created:** [June 30, 2007, 7:19pm UTC](https://forum.kirupa.com/t/create-dynamic-move-clips-then-set-properties/230980 "2007-06-30T19:19:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjb](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@bjb](https://forum.kirupa.com/u/bjb)\
**Post date:** [June 30, 2007, 7:19pm UTC](https://forum.kirupa.com/t/create-dynamic-move-clips-then-set-properties/230980/1 "2007-06-30T19:19:00Z")

</div>

Hi -  
I’m trying to walk through building a custom “Tab” control. Right now I have it working with textboxes that I “Converted to Symbols” and then create dynamically. I can create them like so:

```auto

//For every row in the Entryset, create a tab, give it a label of the value in the current row,
    //change its width to fit its label, displace it horizontally to fit next to adjacent tab, and
    //then set its y coord.
    this.mcContent = this.createEmptyMovieClip("mcContent", this.getNextHighestDepth());
    for (var i = 0; i < rowLength; i++)
    {
        mcContent.attachMovie("Tab_MC", "mov" + i + "_mc", i);
        mcContent["mov"+i+"_mc"].label_txt.text = rows*[columns[0].name];
        newColumns* = new ProtoEntrysetColumn(mcContent["mov"+i+"_mc"].label_txt.text, "Any");
        mcContent["mov"+i+"_mc"]._width = mcContent["mov"+i+"_mc"].label_txt.length*8 + 40;
        mcContent["mov"+i+"_mc"]._x = mcContent["mov"+i+"_mc"]._width/2 + spacing;
        spacing = mcContent["mov"+i+"_mc"]._x + mcContent["mov"+i+"_mc"]._width/2;
        mcContent["mov"+i+"_mc"]._y = mcContent["mov"+i+"_mc"]._height/2;
    }

```

I can set the text, and then do something when each tab is clicked (mc.onRelease).

But I’m stuck at trying to make the Tabs look better.

Here’s what I want to do:

1. use a graphic and the 9-slicing to wrap the tabs in good-looking images
2. use a label, textbox, whatever to draw the tab text over the graphic
3. once that works, swap out the graphic when a tab is clicked.

Here’s what I did:  
I imported a graphic and then made it a custom symbol, did the right linkage, etc. Then I added a textbox to that movie clip and gave it an instance name.

But when I dynamically make one of these movie clips, I can’t set the label text. I thought I would be able to reference both the graphic and the label text, but once there are more than one ‘object’ in the Symbol / movieclip, I can’t seem to control them.

Do I need to make a class called Tab or something and then have this handle adding a textbox and graphic to itself? I read both of the tutorials on this site: [http://www.kirupa.com/developer/actionscript/duplicate.htm](http://www.kirupa.com/developer/actionscript/duplicate.htm) and [http://www.kirupa.com/developer/flashcs3/animating\_dynamic\_movieclips\_AS3\_pg1.htm](http://www.kirupa.com/developer/flashcs3/animating_dynamic_movieclips_AS3_pg1.htm) which were helpful in getting started, but can’t figure out what to do now.

Any help or pointing to the right tutorial to read would be great! I’m a beginner w/ action script, but a comfortable programmer. Just haven’t quite put the Flash model all together yet.

THanks!
