Dein Fehler war das du ja nachdem einmal Rechts gedrückt der MC angehalten wurde du musst also eine Schleife machen hier mal der code:
dein_mc:
Bild1)
Bild2)
ActionScript:
pixel = 0;
this.onEnterFrame = function() {
if (pixel<20) {
this._x = this._x+2;
} else {
delete this.onEnterFrame;
}
pixel++;
};
gotoAndPlay(1); // damit er wieder zu bild 1 geht und somit die function wieder ausgeführt wird
Bild3)
ActionScript:
pixel = 0;
this.onEnterFrame = function() {
if (pixel<20) {
this._x = this._x-2;
} else {
delete this.onEnterFrame;
}
pixel++;
};
gotoAndPlay(1); // damit er wieder zu bild 1 geht und somit die function wieder ausgeführt wird