# Need Help plz

**URL:** <https://forum.kirupa.com/t/need-help-plz/264557>\
**Category:** flash\
**Created:** [June 27, 2008, 5:15am UTC](https://forum.kirupa.com/t/need-help-plz/264557 "2008-06-27T05:15:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadowkeeper](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@shadowkeeper](https://forum.kirupa.com/u/shadowkeeper)\
**Post date:** [June 27, 2008, 5:15am UTC](https://forum.kirupa.com/t/need-help-plz/264557/1 "2008-06-27T05:15:57Z")

</div>

I am not that much good at scripting…  
i am working on a web cam game i have almost done but stuck on one concept that is getting the hit count of duplicated movieclips…

```auto

var ballX:Number = (ball_mc._x-videoX)/sizeDif;
    var ballY:Number = (ball_mc._y-videoY)/sizeDif;
    now.draw(video_vobj);
    var valNow:Number = (now.getPixel(ballX, ballY) >> 16 & 0xFF);
    var valBefore:Number = (before.getPixel(ballX, ballY) >> 16 & 0xFF);
    if (valNow>valBefore+30 || valNow<valBefore-30) {
        trace("hit");
        if (ball_mc._currentframe == 1) {
            ball_mc.gotoAndPlay(2);
        }
    }

```

i got a code by searching the net

but it detects the single movieclip i need it to detect the duplicated moviclips also i have duplicated the movieclips by using

```auto

     i = 0;
while (i<10) {
    //duplicateMovieClip("ball_mc", "ball_mc"+i, i);
    dot.duplicateMovieClip("ball_mc"+i, i);
    trace("dot"+i);
    i++;
}

```

i tried calling the [“ball\_mc”+i] in the place of ball\_mc but it is giving me the hit count of the last movieclip i.e ball\_mc 10

Plz any one who can help me out

thanks in advance
