Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-14-2007, 07:58 AM
Junior Member
 
Join Date: Mar 2007
Posts: 6
Default FFish_AsynRun problem

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
Reply With Quote
  #2 (permalink)  
Old 03-17-2007, 08:30 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:FFish_AsynRun problem

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!");
}
}
Reply With Quote
  #3 (permalink)  
Old 03-19-2007, 01:25 PM
Junior Member
 
Join Date: Mar 2007
Posts: 6
Default Re:FFish_AsynRun problem

thank you so much :-*
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:10 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.