Im following this tutorial,http://www.flash-game-design.com/flash-tutorials/dynStar-flash-tutorial.html. And i keep receiving errors of unidentified methods,
Here is my Code,
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 = random(Stage.width);
mc._y = random(Stage.height);
mc.speed = random(maxSpeed-minSpeed)+minSpeed
var size = random(2)+0.6*(random(4));
mc._width = size;
mc._height = size;
}
this.onEnterFrame = function(){
for(var j=0; j<stars;j++){
var mc = this["star"+j];
if (mc._y>0){
mc._y -= mc.speed ;
} else{
mc._y = stage.height;
mc.speed = random(maxSpeed-minSpeed)+minSpeed
mc._x = random(Stage.width);
}
}
}
Perhaps you have not correctly linked your movieclip in your library to have an instance/identifier name of "star" in which case look at the first part of that tutorial.
The other possibility is that the method "random" has actually been deprecated, so depending on your version of Flash player maybe it isn't working. Try Math.random instead.