# Sharedobject question

**URL:** <https://forum.kirupa.com/t/sharedobject-question/301308>\
**Category:** Uncategorized\
**Created:** [December 7, 2009, 12:47pm UTC](https://forum.kirupa.com/t/sharedobject-question/301308 "2009-12-07T12:47:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![azafoxley](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@azafoxley](https://forum.kirupa.com/u/azafoxley)\
**Post date:** [December 7, 2009, 12:47pm UTC](https://forum.kirupa.com/t/sharedobject-question/301308/1 "2009-12-07T12:47:37Z")

</div>

Hi guys, i have a question.

Im adding content from the library using a menu and as it is being added to the stage im changing the name of it. The reason im doing this is that i want everything thats being added to the stage to become a local sharedobject so it remembers the x and y of the movieclips on the stage and if i dont change the name of it there all being added to the stage with the same name which is addbox and when i make addbox a sharedobject it only saves the last position of the last added movieclip even though there could be 6 clips on the stage.

I think ive set it up the right way by renaming the movieclips as they are being added and i was wondering how i would make everything thats being added to the stage a sharedobject

```auto

var i:int = 0;

function addcontent(e:MouseEvent):void 
{

    var addbox:MovieClip;
    
    
    switch (e.target)
    {
        case housemenu_mc.houseone_mc: addbox = new houseoneselected();
            break;
        case housemenu_mc.housetwo_mc: addbox = new housetwoselected();
            break;
        case housemenu_mc.housethree_mc: addbox = new housethreeselected();
            break;
        case treemenu_mc.treeone_mc: addbox = new treeoneselected();
            break;
        case treemenu_mc.treetwo_mc: addbox = new treetwoselected();
            break;
    }
//sets the position of the variable and adds it to the stage        
    
    
    addbox.x = 0;
    addbox.y = -170;
    planet.planet_mc.addChild(addbox);
    
    addbox.name = "addbox"+ ++ i;
    
   
    
}

```

Im not quite sure what im suppose to be referencing when making something a sharedobject.Is it still addbox or is it the new name?
