Potresti provare con un "prototipo" del genere:
codice:
//
MovieClip.prototype.sliding = function (passo) {
this.alt = false;
id = this._name.substring(this._name.length-1, this._name.length);
this.centro = this.oggetto1._x
this.larghezza = this.oggetto1._width;
this.destra = this.centro+this.larghezza;
//
this.oggetto1.duplicateMovieClip("oggetto2", 2);
this.oggetto2._x = this.destra;
this.onEnterFrame = function () {
if (this.alt) {
delete this.onEnterFrame;
} else {
this.oggetto1._x -= passo;
this.oggetto2._x -= passo;
this.n1X = this.oggetto1._x;
this.n2X = this.oggetto2._x;
if (this.n1X<this.n2x) {
if (this.n2X<=this.centro) {
this.oggetto1._x = this.destra;
}
} else {
if (this.n1X<=this.centro) {
this.oggetto2._x = this.destra;
}
}
}
}
}
//
per applicarlo ad un movieclip sarà sufficiente scrivere:
tuoclip.sliding(2);
Il valore fra parentesi determina la velocità di spostamento: più è bassa la cifra, più è lento lo spostamento.