# Creating empty movieclip

**URL:** <https://forum.kirupa.com/t/creating-empty-movieclip/111388>\
**Category:** Uncategorized\
**Created:** [May 26, 2004, 2:15pm UTC](https://forum.kirupa.com/t/creating-empty-movieclip/111388 "2004-05-26T14:15:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mistdreamz](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mistdreamz](https://forum.kirupa.com/u/mistdreamz)\
**Post date:** [May 26, 2004, 2:15pm UTC](https://forum.kirupa.com/t/creating-empty-movieclip/111388/1 "2004-05-26T14:15:39Z")

</div>

how do i create an empty movie clip say, a rectangle, with only the outlines and no fill? the rectangle border will load at a position, say, (0,0), then when i mouseover on the other buttons, it will ease to their coordinates, but the length will change according to the text length  
i wan to use it for my nav bar

wad i currently have is

onClipEvent(load) {  
n = this.createEmptyMovieClip(“bar”,1);  
n.beginFill(0xcccccc,100);  
n.lineTo(0,5);  
n.lineTo(-0.1,5);  
n.lineTo(-0.1,0);  
n.lineTo(0,0);  
n.endFill();  
n.\_y -= n.height;  
}

i copied this source from somewhere…thanx in advance

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 26, 2004, 4:23pm UTC](https://forum.kirupa.com/t/creating-empty-movieclip/111388/2 "2004-05-26T16:23:12Z")

</div>

mmmh, onClipEvent(load) can only be used on MCs. So you’d have to create an empty MC. Since you’re asking how to create an MC with ActionScript, you’d have to use the

“this.onEvent syntax”

```auto

_root.onLoad = function(){
         this.createEmptyMovieClip("bar", 1)
         with (bar){
            lineStyle(0, 0x000000, 100)
            lineTo(0,5)
            lineTo(5, 5)
            lineTo(5,0)
            lineTo(0,0)
         }
}

```

You can now use “bar” as the instance of a MovieClip that was manually created in Flash (w/o AS).

```auto

_root.onEnterFrame = function() {
	bar._x += 3;
};

```

Have fun experimenting with your menu.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 29, 2004, 10:15am UTC](https://forum.kirupa.com/t/creating-empty-movieclip/111388/3 "2004-05-29T10:15:05Z")

</div>

thank you for answering my qns, but i wan it to change size when i rollOver on everybutton, according to the text length…assuming u noe the text length, how’d u do it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 29, 2004, 1:38pm UTC](https://forum.kirupa.com/t/creating-empty-movieclip/111388/4 "2004-05-29T13:38:37Z")

</div>

What textfield is your text in?

scotty(-:
