added callback functions to record, stop and playback in actionscript and javascript