Das geht nur über Bildaktionen.
Du gibst der Schaltfläche im MC folgendes AS:
PHP-Code:
on (press) {
startDrag(this);
ausrichten = false;
}
on (release) {
stopDrag();
ausrichten = true;
}
Den MC selbst gibst du ein onClipEvent ActionScript:
PHP-Code:
onClipEvent (load) {
ausrichten = true;
ausx = 225;
ausy = 170;
}
onClipEvent (enterFrame) {
if (ausrichten == true) {
neux = (ausx-this._x)*0.2;
neuy = (ausy-this._y)*0.2;
this._x = this._x+neux;
this._y = this._y+neuy;
}
}
Anhang eine Demo des Scripts in Flash5