# Variable problem

**URL:** https://forum.kirupa.com/t/variable-problem/248539
**Category:** Uncategorized
**Created:** [January 9, 2008, 1:00pm UTC](https://forum.kirupa.com/t/variable-problem/248539 "2008-01-09T13:00:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![W84me](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/w84me/32/1257_2.png) [@W84me](https://forum.kirupa.com/u/W84me)
#### Post date: [January 9, 2008, 1:00pm UTC](https://forum.kirupa.com/t/variable-problem/248539/1 "2008-01-09T13:00:46Z")

</div>

Hi all!

I have this functions which attaches movieclips on the Stage and makes them move clockwise. The problem is i cant pass the radius\* variable to the new movieclips.

the code

```auto
function placeItems(itemName:String, num:Number) {
    var angle:Number = 0;
    var radius:Array = new Array();
    
    for (var i:Number = 0; i<num; i++) {
        radius* = Math.floor(Math.random()*100);

        this.attachMovie(itemName,"item"+i+"_mc",this.getNextHighestDepth());
        
        this["item"+i+"_mc"].onEnterFrame = function() {
            this._x = Stage.width/2+(radius**(Math.cos(angle*(Math.PI/180))));
            this._y = Stage.height/2+(radius**(Math.sin(angle*(Math.PI/180))));
            angle++;
        };

    }
}

placeItems("test",5);

```

Thank you in advance!
