# addChild problm: different instances accepting same evnt listners

**URL:** <https://forum.kirupa.com/t/addchild-problm-different-instances-accepting-same-evnt-listners/309033>\
**Category:** flash\
**Created:** [May 5, 2010, 10:36am UTC](https://forum.kirupa.com/t/addchild-problm-different-instances-accepting-same-evnt-listners/309033 "2010-05-05T10:36:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adBuryD](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@adBuryD](https://forum.kirupa.com/u/adBuryD)\
**Post date:** [May 5, 2010, 10:36am UTC](https://forum.kirupa.com/t/addchild-problm-different-instances-accepting-same-evnt-listners/309033/1 "2010-05-05T10:36:54Z")

</div>

this is the begining of the code

```auto
package{
public class scriptsTrePntzero extends Sprite
    {
        public function scriptsTrePntzero ()
        {
            stage.addEventListener (MouseEvent.MOUSE_DOWN, addMcInstances);
        }

```

the function addMcInstances

```auto

private function addMcInstances (e:MouseEvent)
        {
            var container:Sprite = new Sprite();
            var circle:Shape = new Shape();
            pressed = true;
            var xpos:Number= mouseX;
            var ypos:Number= mouseY;
            circle.graphics.beginFill ( 0xff9933 , 1 );
            circle.graphics.drawCircle ( 0 , 0 , 10 );
            container.addChild (circle);
            addChild ( container );
            container.x =xpos ;
            container.y =ypos;
            container.addEventListener (Event.ENTER_FRAME, scaleTheMc);
        }

```

the function

```auto

private function scaleTheMc (event:Event)
        {
            var theBall = event.target;
            
            if (pressed == true)
            {
                theBall.scaleX +=0.2 ;
                theBall.scaleY +=0.2;
            }
            theBall.addEventListener (MouseEvent.MOUSE_UP, deleteEnterFrame);
        }

```

\*\*my script causes the scaling of all the instances of the sprite at the same time while i am expecting individual instances scaling … \*\*  
What am i doing wrong, pls help me OR if you can point me out to some thread addressing a similar query would be nice … thank you
