Instant Replay is a small as3 service that can be used to record and playback user interactions.
Simply register the display object that you wish to record/playback.
InstantReplay.register(stage); |
Next, when you’re ready to record interactions set the record property to true.
InstantReplay.record = true; |
Finally, call the play function to playback the recorded interactions.
InstantReplay.play(); |
You’ll obviously also need to add an event listener to the display object that you’ve registered otherwise you won’t actually see anything happening.
private var bitmap:Bitmap; public function Main():void { bitmap = new Bitmap(new BitmapData(50, 50, false, 0xFF0000)); addChild(bitmap); stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMove); } private function OnMouseMove(e:Event):void { bitmap.x = e.stageX; bitmap.y = e.stageY; } |
Example below:
Will this work with Starling as well?
It wasn’t designed to work with Starling, but may well work just fine with Starling because I would think the events would be past all the way up to the starling layer.. BUt if it doesn’t work out of the box you could modify the source fairly easily.