so idea is simple, images are placed on stage and every time moveS is engaged by timer event all the images have their Xcord updated via their UILoader and are moved either direction by so much once they reach their -/+ Xcord destonation limit their X cord is switched to either starting -x or ending +x cord based on their direction of movement so that the loop is created.
first couple of loops its smooth but then i get different space size between images and its iregular pattern.
so i wondering is there is better solution to this loop of images
should i work with movie clips instead like created multiple instances of them which hold same pictures and loop them around like that.
any solutions?
code:
//Animation
var moveTimer:Timer = new Timer(speedUseable);
moveTimer.addEventListener(TimerEvent.TIMER, moveS);
moveTimer.start();
var speed:Number = 1;
var minSpeed:Number = -3;
var maxSpeed:Number = 3;
var rangeSpeed:Number = maxSpeed - minSpeed;
function moveS(e:TimerEvent):void
{
speed = mouseX / stage.stageWidth * rangeSpeed + minSpeed;
for (var i:Number=0; i<=picQTY; i++)
{
this["image"+i].x -= speed;
if (this["image"+i].x < -imageWidthSwfPar+speed)
{
this["image"+i].x = picQTY*imageWidthSwfPar-imageWidthSwfPar;
} else if (this["image"+i].x > picQTY*imageWidthSwfPar-imageWidthSwfPar) {
this["image"+i].x = -imageWidthSwfPar-speed;
} else {
}
}
}