I'm making a game for the WiggiWorld contest, and I'm having a problem with the restriction of the use of _root. Normally, I wouldn't have a problem with this because I'm coding on the main timeline, but when I use my code in a setInterval function, using "this" refers to the function instead of the timeline, and using _parent doesn't work (for some strange reason) either. Is there anyway to break out of the set Interval function using _parent instead of using _root.
Here is my code
i = 0;
numclouds = new Array();
cloudmove = setInterval(function () {
i++;
numclouds.push(i);
duplicateMovieClip(cloud, "cloud"+i, i+500);
_root["cloud"+i].gotoAndStop(random(6)+1);
_root["cloud"+i]._x = Math.random()*Stage.width;
_root["cloud"+i]._y = -600;
trace(_root["cloud"+i]._x);
}, Math.random()*700+500);
If you replace _root with _parent or with this, the clouds duplicate, but they do not change their current frame, their x value, or their y value.
Here is the function with _root
Here is the function with _parent
Here is the function with this
and
Here is the .fla file containing the clouds and the function