Horizontal move loop

I would like to achieve the same effect as the animation present on this site www.ruisoaresesteves.com , but instead of animation I would like to achieve it with AS. Now the thing is that the images are large o so I can’t put them lined up otherwise it would be relatively simple. What I’m trying to acomplish is getting each PIC(image segment) go back to the other end of the frame and move when the next PIC reaches a certain position. Is this the better way to do it?
Here is my code:

[COLOR=Blue] speed = -2;
onEnterFrame = function () {
if (PIC1._x<-578) {
PIC2._x = 798;
PIC2._x = speed;
if (PIC2._x<-602.0) {
PIC3._x = 798;
PIC3._x = speed;
if (PIC3._x<-503.0) {
PIC4._x = 798;
PIC4._x = speed;
if (PIC4._x<-607.0) {
PIC5._x = 798;
PIC5._x = speed;
if (PIC5._x<-1128.0) {
PIC6._x = 798;
PIC6._x = speed;
if (PIC6._x<=-1353.0) {
PIC1._x = 798;
PIC1._x = speed;
Hope you can look at it and make something out of it. Thanks for any help on this.