# Adding MC to stage

**URL:** <https://forum.kirupa.com/t/adding-mc-to-stage/298370>\
**Category:** Uncategorized\
**Created:** [October 17, 2009, 12:41pm UTC](https://forum.kirupa.com/t/adding-mc-to-stage/298370 "2009-10-17T12:41:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daimz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/daimz/32/2383_2.png) [@Daimz](https://forum.kirupa.com/u/Daimz)\
**Post date:** [October 17, 2009, 12:41pm UTC](https://forum.kirupa.com/t/adding-mc-to-stage/298370/1 "2009-10-17T12:41:22Z")

</div>

How can I link to a movie in my libary to tell it to behave like a button.  
This is what I have tried but it’s not working.

```auto
var selectedButtons:Array = loadButtons();

var itemX:Number = 100; // initial item x position
var itemY:Number = 100; // initial item y position

for each( var buttonName:String in selectedButtons )
{
    var item:DisplayObject = null;

    if( buttonName == "apple" )
    {
      item = new apple();

      apple.addEventListener(MouseEvent.CLICK, shirt);
    function shirt(e:MouseEvent):void {
    trace("Clicked");
}
    }
    else if( buttonName == "banana" )
    {
       item = new banana(); 
    }
    else if( buttonName == "cherry" )
    {
        item = new cherry(); 
    }
        else if( buttonName == "pineapple" )
    {
        item = new pineapple(); 
    }
        if( item != null )
    {
        addChild( item );
        item.x = itemX;
        item.y = itemY;

        itemX += item.width + 20; // 20 = space between items
    }

}

```

As you can see I am adding the Movies to my stage throught thier class name(apples etc). How come I can’t link to it? Is it because I need to be using an instance name? And if so I would I assign one?
