This code works properly when published by Flash CS 5.5 as .swf (it prompts to browse where to save the file). However, when it is published to HTML, it doesn't work (doesn't prompt to browse the destination). Is it security issue or other problem?
import flash.display.Sprite;
import flash.media.Microphone;
import flash.system.SecurityDomain;
import org.bytearray.micrecorder.*;
import org.bytearray.micrecorder.events.RecordingEvent;
import org.bytearray.micrecorder.encoder.WaveEncoder;
import flash.events.Event;
import flash.net.FileReference;
import flash.utils.setTimeout;
var mic:Microphone;
var waveEncoder:WaveEncoder = new WaveEncoder();
var recorder:MicRecorder = new MicRecorder(waveEncoder);
var fileReference:FileReference = new FileReference();
mic = Microphone.getMicrophone();
mic.setSilenceLevel(0);
mic.gain = 100;
mic.setLoopBack(true);
mic.setUseEchoSuppression(true);
Security.showSettings("2");
addListeners();
function addListeners():void
{
setTimeout(startIntroTime,3000);
function startIntroTime():void
{
startRecording();
setTimeout(stopRecording,5000);
}
recorder.addEventListener(Event.COMPLETE, recordComplete);
}
function startRecording():void
{
if (mic != null)
{
recorder.record();
}
}
function stopRecording():void
{
recorder.stop();
mic.setLoopBack(false);
}
function recordComplete(e:Event):void
{
fileReference.save(recorder.output, "recording.wav");
}