
Код AS1/AS2:
var savedData:Array = new Array();
var arrow:MovieClip = this.createEmptyMovieClip('arrow', this.getNextHighestDepth());
arrow.beginFill(0xFF0000, 100);
arrow.moveTo(0, 0);
arrow.lineTo(10, 0);
arrow.lineTo(10, 10);
arrow.lineTo(0, 10);
arrow.lineTo(0, 0);
arrow.endFill();
setTimeout(this.stopRecord, 5e3, this);
var i:Number = 0;
this.onEnterFrame = function():Void {
this.savedData[i++] = {x:this._xmouse, y:this._ymouse};
}
function stopRecord(scope:Object):Void {
delete scope.onEnterFrame;
scope.playRecord();
}
function playRecord():Void {
i = 0;
this.onEnterFrame = function():Void {
this.arrow._x = Number(this.savedData[i].x);
this.arrow._y = Number(this.savedData[i].y);
if ( !this.savedData[++i] ) delete this.onEnterFrame;
};
}