# Shared Object & Children

**URL:** <https://forum.kirupa.com/t/shared-object-children/281673>\
**Category:** flash\
**Created:** [February 12, 2009, 1:47am UTC](https://forum.kirupa.com/t/shared-object-children/281673 "2009-02-12T01:47:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darngooddesign](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@darngooddesign](https://forum.kirupa.com/u/darngooddesign)\
**Post date:** [February 12, 2009, 1:47am UTC](https://forum.kirupa.com/t/shared-object-children/281673/1 "2009-02-12T01:47:44Z")

</div>

In a nutshell I’m adding duplicates of the same child when the user clicks on “addBtn”. How would I use SOs to save the children that have been added?

Cheers

My code:  
var container\_mc:MovieClip;  
var juryMC:MovieClip;  
container\_mc = new MovieClip();  
addChild(container\_mc);  
addBtn.addEventListener(MouseEvent.CLICK, onAdd);  
function onAdd(evt:MouseEvent):void {  
juryMC = new jury();  
juryMC.x = Math.random() \* stage.stageWidth;  
juryMC.y = Math.random() \* stage.stageHeight;  
container\_mc.addChild(juryMC);  
}
