Posted by Sil in SWF Studio V3 on Feb 21 2008, 04:18 pm

Hi,
I've made an animated swf that installs (open exe files) many aplications. It is a opening screen of a program instalation.
It has bottons for choose wich aplication should be installed. The user have to select the aplications and click "Install".
Before excute the exe files, it prompts a message asking if the user are sure about installing each one.

My problem is: All installation wizards begins only after all prompt questions is answred insted of ask and install one at a time.

How could I make the function open each aplicattion imediatly after the "are you sure" question is answred? No problem if the next question appears behind the installation screen since the wizards opens one at a time. They are opening all together.

PS: Sorry if its not clear, english is not my native language.


Posted by northcode in SWF Studio V3 on Feb 21 2008, 06:56 pm

By default, SWF Studio commands operate in asynchronous mode. You probably want your stuff to execute synchronously instead.

Check out the Synchronous Commands section of the Help under Getting Started.


Posted by Sil in SWF Studio V3 on Feb 22 2008, 10:15 am

I think its already in synchronous mode.
The function code:


ssCore.init();
ssDefaults.synchronousCommands = true;

function OpenAp(Ap_Name, file_path) {
   var check_path:Object = ssCore.FileSys.fileExists({path:file_path});
   if (check_path.result == 'FALSE') {
      ssCore.App.showMsgBox({prompt:'System not avaiable.', icon:'critical'}, {callback:'answer'});
   } else {
      var question = ssCore.App.showMsgBox({icon:'question', buttons:'YesNo', defaultButton:'button2', prompt:'Are yousure about intalling' + Ap_Name + '?' });
      ssDebug.trace(question.result);
      if (question.result == 'YES') {
         fscommand ("exec", file_path);
      }
   }
}



Is it synchronously, isnt it?
All the string variables like paths and questions is defined before function.
I call the function in onPress event this way:

var path_ct = "startdir://CTBWIN/ctb_unico.exe";

   if (sel_ct) { 
         OpenAp('Contábil', path_ct);
   }

And repeat for each one system


Posted by northcode in SWF Studio V3 on Feb 22 2008, 12:58 pm

Once you add a callback: to the callback parameters object the call becomes asynchronous. Displaying a message box this way means you could have multiple message boxes being opened.