# Clip referencing problem

**URL:** <https://forum.kirupa.com/t/clip-referencing-problem/244019>\
**Category:** flash\
**Created:** [November 13, 2007, 5:24pm UTC](https://forum.kirupa.com/t/clip-referencing-problem/244019 "2007-11-13T17:24:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bardic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bardic/32/3708_2.png) [@bardic](https://forum.kirupa.com/u/bardic)\
**Post date:** [November 13, 2007, 5:24pm UTC](https://forum.kirupa.com/t/clip-referencing-problem/244019/1 "2007-11-13T17:24:01Z")

</div>

I’m having some problems with a little script I’m working on that will create circles in a movieclip so that I can position them later. The problem is that the circle doesn’t seem to be drawing within the clip. I trace it’s x,y,width and height and it’s all 0…

Here’s what I have so far.

```auto

function drawCircle(centerX, centerY, radius, sides, clpNm, clr){
    this.createEmptyMovieClip([clpNm],this.getNextHighestDepth());
    [clpNm]moveTo(centerX + radius, centerY);
    [clpNm]lineStyle(0);
    [clpNm]beginFill(clr,100);
    
    for(var i=0; i<=sides; i++){
        var pointRatio = i/sides;
        var pointX = centerX + Math.cos(pointRatio*2*Math.PI) * radius;
        var pointY = centerY + Math.sin(pointRatio*2*Math.PI) * radius;
        [clpNm]lineTo(pointX, pointY);
    }
    
    [clpNm]endFill();
    trace(w._width);
    twitch(clpNm);
}

drawCircle(25, 25, 25, 150,"w",0x333333);

```

The problem is almost definitely with the naming of the clip I think, but I can’t figure it so. Any help would be great.
