Creating moving clouds
Hi
I have this assignment where we have to use a display list. I am trying to create clouds moving on the background.
I'm sure my code is very clumsy. I was able to get the clouds on my stage but I can only get one to move.
Please, I can't seem to wrap my head around this and as you can see I'm a novice.
import flash.display.*;
import flash.events.*;
var myBackground:BackGround = new BackGround();
addChild(myBackground);
var myCloud:MyCloud;
for (var i:Number = 0; i<6; i++)
{
myCloud = new MyCloud();
addChild(myCloud);
var randomValue: Number = Math.random()*2;
myCloud.x = Math.random()*stage.width;
myCloud.scaleX = myCloud.scaleY = randomValue;
}
myCloud.addEventListener(Event.ENTER_FRAME, flyBy);
function flyBy(event:Event):void
{
myCloud.x +=6;
if (myCloud.x> stage.stageWidth)
{
myCloud.x = 0;
}
}
addChild(myCloud);
