Accessibility

Table of Contents

Setting up a Flash project for local and network playback

Helpful tips for local Flash media delivery

Two general scenarios exist for deploying web-based applications locally. The first scenario deploys an application that works both online and offline. The second scenario deploys an application that works only offline. While the scenarios share some commonalities, you'll find that the right approach for your project will be based on your specific needs.

The following tips are based on insights from my last project, in which I had to deliver a single application capable of online and offline playback. The application was built to use images, audio, an ActiveX audio recorder, and data (XML) supplied from external files.

Tip 1: Supply media and external data locally for local playback

Whether you use a Flash projector, a SWF file, or a SWF file embedded in an HTML page, applications intended for local delivery should include all their content locally along with the SWF. Usually, the rationale for creating a local Flash application is the desire not to have to be connected to the Internet or to at least not have to download all the related assets.

If content can be contained entirely in a single SWF file, taking this route will provide the easiest local delivery method. In cases where text needs to be split from the SWF for localization, use text files or XML files supplied with it. When dynamic templates are being used, split the images, audio, and text from the SWF to files stored alongside the application. When your Flash application needs to communicate with a server in addition to loading local content, set the FLA file's local security publish settings to local files only and allow the application as a trusted site on a client-by-client basis.

Tip 2: Run local files from a local drive instead of a CD

Generally, when distributing a locally run Flash application, you will use either a CD or web page download as a delivery method. In regards to the CD-based delivery method, there are a handful of useful things to know. One of the first things to consider is that Flash applications built with a website structure tend to load slowly when played directly from a CD or DVD. The limitations are related to the CD player read speed and a number of hardware factors that are not normally involved with delivering a web-based application.

It could be considered a best practice to run Flash applications built with a website structure on a local drive instead from the CD drive. This means that the application folder would be manually copied from a CD to the user's hard drive, copied from the CD to a hard drive via an installation program, or downloaded to a user's hard drive from a website installation page.

Note: Several inexpensive and freeware applications are available to help create an installation application for you—for example, Advanced Installer from Caphyon (Windows only) and DropDMG from C-Command Software (Mac OS). Either may be a good option for delivering by CD or download.

Tip 3: Use an Autorun.inf file to play a CD automatically

If you use a CD to deliver a Flash application or an installation file that installs a Flash application, you can place a text file on the CD that will autorun an executable or HTML file. In the case of an executable installation file, the installation dialog box appears and prompts the user to proceed. In the case of the HTML file, a browser opens and displays the file.

To create an autorun file and include it on your CD, follow these steps:

  1. Open Note Pad or any text editor and enter the following text into the editor:

    [autorun]
    open=InstallerFileName.exe
  2. Replace the InstallerFileName text with the name of your file. If you're targeting an HTML file instead of an executable file, use the following format:

    [autorun]
    shellexecute=index.htm
  3. Save the file next to your Flash application. Name the file Autorun.inf while saving it.
  4. Burn the Autorun.inf file and the executable installation file (or site files) onto the same CD.
  5. Play the CD to see the autorun feature work.

Note: Including this file will work for running files from a CD on a computer running Windows.

Tip 4: Supply instructions for client settings using the Global Settings Manager

For Flash applications that will be deployed locally, load local content, and need to access Internet-based features and network-only files, you will have to allow the application as a trusted site on a client-by-client basis. This process needs to occur only once per client, and the client must be online to do it.

It's a best practice to provide the user with some kind of documentation on the steps necessary to allow the application as a trusted site using the Settings Manager.

Tip 5: Create an installation page for ActiveX content and local security settings instructions

When working with ActiveX content and global security settings for Flash Player, you have to connect to the Internet at least once for installation and security settings management. If you're building an application with complex needs, it's a good idea to build a web page that includes an installation of the required ActiveX controls and instructions regarding how the viewer should allow the application as a trusted site. The URL is supplied along with the delivery of the application, and visiting it becomes a requirement for the installation process.

Note: In general, ActiveX controls are not designed to be friendly to use for local browser playback. If you try to run an ActiveX control locally from a browser, the ActiveX control has to be installed from the Internet alongside the application in a location on the active user's desktop. This can get really tricky in any kind of a nonstandard computer configuration. It's a best practice to avoid using these types of controls for local browser playback and to stick with simply creating a security settings instructions page. Alternatively, you may want to consider using the strengths of Director or Authorware to combine web content such as SWFs and ActiveX controls.

Besure to visit the Active Content Developer Center for more information about using active content in some web pages.

Tip 6: Use XML and shared objects to store and synch data

You can use local shared objects to store persistent data locally between application sessions. Flash shared objects are similar to browser cookies in that they save runtime data to the local hard drive. Assuming the client has allowed the local application as a trusted site, the application could load initial settings from static local XML files, save data to local shared objects during offline usage, and (if required) sync to a server to save the data at a later time when the client has returned to an online status.

Where to go from here

If you are seriously pursuing local Flash content delivery, your best option will be to watch for the upcoming release of Adobe AIR as an official cross-OS runtime platform wherein the experience will be improved for web-based applications on the desktop. In the meantime, familiarize yourself with the information in this article and the various security resources available in the Flash Player Developer Center.

Here are a few resources to get you started: