If you've ever developed a kiosk application in Flash you've probably struggled with finding a way to suppress the Print Dialog so your users don't have to press the OK button.

Doing this in Flash, by itself, is impossible. The solution using SWF Studio is so easy you can have it working in under 5 minutes!



SWF Studio has a generic solution for reacting to dialogs so you can use this trick to handle any type of dialog. To keep things simple we're just going to look at how to automatically confirm Print dialogs for now.

Here's the code.

ssCore.App.setNotify({event:"onDialog"}, {callback:onDialog});

function onDialog(result_obj, callback_obj, error_obj)
{
   var info:Array = result_obj.result.split(",");

   hwndDialog = info[0];
   isChild = info[1];
   captionDialog = info[2];

   if (isChild == "TRUE")
      if (captionDialog == "Print")
         ssCore.App.confirmDialog({hwnd:hwndDialog});
}

To get rid of the Print dialog just drop that code into the initialization code of your application. As long as it runs before you try to print something you'll never see another Print dialog in your application.