pretty simple question for most of you prolly… i’m still trying to wade myself through the Ocean of Actionscript ;p.
My basic layout is i got ground… and above the ground… i got a sky (pretty complex eh)
I got a few clouds up in the sky that i just want to move to the right, and keep moving across the screen non-stop, i looked at most the tutorials with movement across the screen, but they coincided with mouse movement…and i dun want them to be affected by the mouse.
If someone could just point me in the right direction it’s be much appreciated =D
MovieClip.prototype.moveMe = function (begin, end, speed) {
if (this._x <= end) {
this._x += speed
} else {
this._x = begin
}
}
now place this script in every cloud:
onClipEvent (load) {
var begin = (0 - (this._width / 2))
var end = (Stage.width + (this._width / 2))
var speed = Math.round (((Math.random() * 4) + 1))
}
onClipEvent (enterFrame) {
this.moveMe (begin, end, speed)
}
the script will move the clouds at a random speed [1 - 4] to the right
when the mc is not visible anymore [at the right] … it will return to the other side [the left] and move again to the right
[size=1]**PS: **my scripting skills are not that good … so maybe someone can clear up the code for you[/size]