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
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?