Accessibility
Jeff Swartz

Jeff Swartz

Adobe

Created:
17 November 2008
User Level:
Beginner, Intermediate
Products:
Adobe AIR

Distributing Adobe AIR applications via the Web

The AIR seamless install application (or badge) lets you install your AIR application through a click on a web page. It also installs or updates the AIR runtime, as needed.

Requirements

To make the most of this article, you need the following software and files:

Adobe AIR

Adobe Flash Player 9 update 3 or later

Prerequisite knowledge

General experience building AIR applications is suggested.

Testing the seamless install

To test the seamless install:

  1. Click the Install Now button, below:

    AlertThis content requires Flash

    To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

    Download the free Flash Player now!

    Get Adobe Flash Player
  2. Follow the instructions in the AIR application installer to install the Hello World application.

Understanding the code

View the source of this web page. The SWF file in the previous section (known as the seamless install badge) is embedded using the JavaScript code defined in the AC_RunActiveContent.js file:

if (hasReqestedVersion) {
	// if we've detected an acceptable version
	// embed the Flash Content SWF when all tests are passed

	AC_FL_RunContent(
		'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab',
		'width','217',
		'height','180',
		'id','badge',
		'align','middle',
		'src','badge',
		'quality','high',
		'bgcolor','#FFFFFF',
		'name','badge',
		'allowscriptaccess','all',
		'pluginspage','http://www.macromedia.com/go/getflashplayer',
		'flashvars','appname=Hello%20World&appurl=http://www.adobe.com/devnet/air/flash/quickstart/seamless_install/HelloWorld.air&airversion=1.5&imageurl=seamless_install/helloworld.jpg',
		'movie','seamless_install/badge' ); //end AC code

The AC_FL_RunContent() function embeds the SWF content in the web page. The last two lines of code define FlashVars settings passed to the SWF content, including the following parameters:

  • appname—The name of the application, displayed by the SWF file when the runtime is not installed.
  • appurl—The URL of the AIR file to be downloaded. You must use an absolute, not relative, URL.
  • airversion—For the 1.5 version of the runtime, set this to 1.5.
  • imageurl—For the 1.5 version of the runtime, set this to 1.5.

Using the seamless install feature in your own web server

Use the source code in this web page, or use the default_badge.html file and other files included in the samples/badge subdirectory of the AIR SDK and the Flex SDK. Be sure to adjust the flashvars settings to match the names and locations of your files.

Where to go from here

This article shows how to easily use the default seamless install interface, included in the AIR SDK and Flex SDK. You can create your own SWF file that uses a custom seamless install interface. For more information on the seamless install feature, see the "Installing and running AIR applications from a web page" section in the "Distributing, Installing, and Running AIR applications" chapter of the developer's guide:

Also be sure to check out Grant Skinners custom seamless install badge, as well as his Badger application for creating easily seamless install badges.

About the author

Jeff Swartz first worked at Macromedia (now Adobe Systems) in 1992. He is currently a technical writer for Adobe AIR. Jeff received a bachelor's degree in Computer Science and Mathematics from the University of Illinois at Urbana-Champaign and studied at the Edinburgh University Department of Artificial Intelligence. Audiences around the San Francisco Bay Area have tolerated Jeff's artistry on the trombone. He has served as Big Frank, a dancing hot dog, for Vienna Beef Ltd.