Loop Problem

Ok. Im making this game where these balls bounce around and you dodge them. Im trying to make it so each new level there are more balls to dodge. So I made this loop.

x=1
“while (x<_global.level) {
ball.duplicateMovieClip(“ball”+x, 1);
setProperty(“ball”+x, _x, random(550));
x++;
}”

_global.level being the levels and ball being my movie clip.

The problem is, it only seems to work once. First level there is one ball. Then the second one there is 2. Then it just keeps going on with two. I realize this might be a stupid question but still any help would be very cool.