|
|||
|
these are my codes in the root of my project
import SWFKit.*; a.onPress = function() { fscommand("FFish_AsynRun", "d"); this._x += 20; }; these are my codes in the "d" script m = new MCI; m.deviceType = "waveaudio"; m.fileName = ""; m.wait = true; m.command = "open"; //set the time format to milliseconds m.timeFormat = 0; //Set the record length to 10 seconds m.to = 2000; m.command = "record"; //save the recording to file m.fileName = "d:\\1.wav"; m.command = "save"; m.command = "close"; It records 1.wav but not in Asynch So whats the difference between FFish_Run and FFishAsyn_Run ? Thx |
|
|||
|
Fscommands are commands sent by the flash player to swfkit. When swfkit receives a "FFish_Run" command, it will execute the specified ffish script immediately, whereas when it receives a "FFish_AsynRun" command, it will not execute the specified ffish script, but put the ffish script into a queue. And when the swfkit application is idle, it will pick the ffish scripts from the queue and execute them. Therefore, using "FFish_AsynRun" does not mean that it will not block the main movie. In your code, the ffish script will wait for 10 seconds to finish, and in that 10 seconds, the main movie cannot be rendered, that is, it is blocked. To avoid the problem, you cannot set the "wait" property to true, and you must handle the on notify event to know when the recording will finish.
Code:
//hello
m = new MCI;
m.deviceType = "waveaudio";
m.fileName = "";
m.command = "open";
//set the time format to milliseconds
m.timeFormat = 0;
//Set the record length to 30 seconds
m.to = 30000;
m.notify = true;
m.onNotify = onNotify;
m.command = "record";
function onNotify(flag)
{
if (flag == 1)
{
//save the recording to file
m.notify = false;
m.fileName = "d:\\1.wav";
m.command = "save";
m.command = "close";
Dialogs.msgBox("Mission accomplished!");
}
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|