using this code for santa's head:
onClipEvent(load) {
speedX = 10;
speedY = 10;
}
onClipEvent(enterFrame) {
this._x += speedX;
this._y += speedY;
if (this._x >= 510) {
speedX = -speedX;
rotate = Math.random()*6-3; // -3 to 3
} else if (this._x <= 30) {
speedX = -speedX;
rotate = Math.random()*6-3; // -3 to 3
}
if (this._y >= 370) {
speedY = -speedY;
rotate = Math.random()*6-3; // -3 to 3
} else if (this._y <= 50) {
speedY = -speedY;
rotate = Math.random()*6-3; // -3 to 3
}
}
onClipEvent(enterFrame) {
this._rotation += rotate;
}
and this code for the snowflakes:
onClipEvent(load) {
this._x = Math.random()*550; // 0 to 550
this._y = Math.random()*400; //0 to 400
speed = Math.random()*3+3; // 3 to 6
drift = Math.random()*2-1; // -1 to 1
rotate = Math.random()*6-3; // -3 to 3
}
onClipEvent(enterFrame) {
this._y += speed;
this._x += drift;
this._rotation += rotate;
//bring back to top
if (this._y >400) this._y = 0;
// one side to another
if (this._x < 0) this._x = 550;
if (this._x> 550) this._x = 0;
}
// create 50 additional snowflakes
onClipEvent(load) {
for(var i=0;i<50;i++) {
snowflake.duplicateMovieClip("snowflak e"+i,i);
}
}
i made this