Actually the issue is that that tutorial is AS2, and a lot of the code doesn't translate to as3. The biggest things are replacing "random" with Math.random(), attachMovie & event.enterFrame with a DisplayObjectContainer class, and _x&_y with just x & y.
I have updated most of the code, my only issue is that i'm not sure what to do with this line:
var mc = this.attachMovie("star", "star"+i,i);
I know I need to create a variable and addChild, but i'm not sure how it applies with generating multiple movie clips from one. I thought addChild only worked for 1 thing. SO any help on how to fix this to work would be great. Just trying to teach myself as I go.
updated so far to:
this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
import flash.display.MovieClip;
import flash.events.Event;
var stars = 100;
var maxSpeed = 16;
var minSpeed = 2
for( var i = 0; i<stars; i++)
{
var mc = this.attachMovie("star", "star"+i,i);
mc.x = Math.random() * stage.stageWidth;
mc.y = Math.random() * stage.stageHeight;
mc.speed = Math.random() * (maxSpeed-minSpeed)+minSpeed
var size = Math.random() * 2+(0.6*(Math.random() * 4));
mc.width = size;
mc.height = size;
}
function enterFrameHandler(event:Event):void
{
var target:MovieClip = MovieClip(event.target);
for (var j = 0; j<stars;j++)
{
var mc = this.("star"+j);
if (mc.y>0)
{
mc.y -= mc.speed;
}
else
{
mc.y = stage.stageHeight;
mc.speed = Math.random() * (maxSpeed-minSpeed)+minSpeed
mc.x = Math.random() * stage.stageWidth;
}
}
};