Robots Rule | MindSculpt.net

New media has met its match.

The MindSculpt Design Syndicate focuses on code that works, from CSS, XHTML and JavaScript tips and tutorials to Flash and ActionScript how-to's. Robots not included.

How to publish Flash .exe and .app files for fullscreen viewing

Michael Becker

Michael has humbly acquired extensive design experience across multiple industry disciplines during his career in new media. In addition to his passion for web and Flash development, he has an uncanny penchant for zombies and robots. Let's be honest, who doesn't?

The following article assumes you have a solid understanding of Flash AS2 and the Flash interface and skips all basic Flash setup instructions and explanations in effort to provide you with quick, concise information.

You’ll occasionally find your client asking you for an executable version of the application you built them. Chances are they’ll also want that executable to open fullscreen. Flash can quickly compile executable files for Windows and Mac environments.

Step 1: Adding Some ActionScript
In the actions layer of your application, specify the following (place it at the top, underneath your class import statements, for consistency and best practice):

AS2:

  1. // prevents resizing regardless of HTML embed code settings
  2. Stage.scaleMode = "noScale";
  3.  
  4. // align the .swf to Top Left
  5. Stage.align = "tl";
  6.  
  7. // call fscommand from flash
  8. fscommand("fullscreen", "true");
  9. fscommand("allowscale", "false");

AS3:

  1. // import flash classes
  2. import flash.display.*;
  3.  
  4. // prevents resizing regardless of HTML embed code settings
  5. stage.displayState = StageDisplayState.FULL_SCREEN;
  6. stage.scaleMode = StageScaleMode.NO_SCALE;
  7. stage.align = StageAlign.TOP_LEFT;
  8.  
  9. // call fscommand from flash
  10. fscommand("fullscreen", "true");
  11. fscommand("allowscale", "false");

Detailed information about fscommand() and its additional parameters is beyond the scope of this article.

Step 2: Publish Settings (AS2 and AS3)
In the Formats tab in Flash’s publish settings (File > Publish Settings), you’ll see a bunch of options. The last two checkboxes allow you to export a .exe (Windows) or .app (Mac) version of your application.

If you just need to provide a .exe, you’re all done with the export step and you can skip to Step 4. If you’re providing a .app version instead/in addition, move on to the next tricky step…

Step 3: View Package Contents of .app File (Mac Executables Only, AS2 and AS3)
Now that you’ve published out your .app file, locate it in the publish directory you’ve specified in the Publish Settings panel. This file will launch to fit your monitor’s window, however with uncertain inconsistency and most likely with a browser title bar. No problem, here’s the fix:

  • Right click on the .app file and choose Show Package Contents
  • Locate the Info.plist file and open it in TextEditor or a similar editor
  • Browse towards the end and locate the end of the <array></array> node
  • Add the following node, alphabetically, as an additional <key> node:
  • <key>CSResourcesFileMapped</key>
    <true/>
    <key>LSPrefersCarbon</key>
    <string>YES</string>
    <key>CSResourcesFileMapped</key> <true/> <key>LSPrefersCarbon</key>
    <string>YES</string>

    <key>LSUIPresentationMode</key>
    <integer>4</integer>

    <key>NSAppleScriptEnabled</key>
    <string>YES</string>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright 1996-2009 Adobe Systems Incorporated and its licensors. All Rights Reserved.</string>

  • Save your file
  • Now test your app

Note that your XML list may differ from the example above. As long as you drop the <key>LSUIPresentationMode</key> node above in the right alphabetical order, it will yield the desired results.

Step 4: Packaging your files for delivery
Now that your executable files are ready for delivery for either platform, it’s time to package them up and get them ready for hand-off.

Create a new folder to house your .exe and/or .app files. These files act like a .swf, so don’t forget to include all external-loading files (XML, folders, images, etc.) in your delivery package. You’re all set.

Share this post:
  • Twitter
  • Facebook
  • del.icio.us
  • Digg
  • LinkedIn
  • Reddit
  • StumbleUpon
  • Technorati
  • Google Bookmarks
  • Yahoo! Buzz

Category: Flash AS2, Uncategorized


Leave a Reply



Back to top