by Jeff Swartz

Jeff Swartz

Created

17 November 2008

Requirements
Prerequisite knowledge

General experience building AIR
applications is suggested.
Required products

User level

Beginning
 
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.
 
Testing the seamless install
 
To test the seamless install:
 
    1. Click the Install Now button, below:
Hello World
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 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, includingthe following parameters:
 
  • appname—The name of the application, displayed bythe SWF file when the runtime is not installed.
  • appurl—The URL of the AIR file to bedownloaded. 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/badgesubdirectory 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:
 
  • For Flex developersFor
  • Flash developers
  • For HTML developers

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