Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Facebook /

Create your first Flex and Facebook application – Part 2: Package and deploy as a desktop application

by Jeanette Stallons

Jeanette Stallons
  • stallons.com

Content

  • Package the AIR application
  • Install the application from an AIR file
  • Create a native installer to install from the desktop
  • Create a badge installer to install from a web page
  • Add update capability

Modified

26 September 2011

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Adobe AIR application deployment desktop Facebook Flash Builder 4 Flex social networking

Requirements

Prerequisite knowledge

  • Basic knowledge of web technologies and object-oriented programming principles is helpful.
  • Create your first Flex and Facebook application – Part 1
  • Flash and Facebook technology overview
  • Flash and Facebook architecture overview

 

You also need:

- A Facebook account: Sign up

- A registered Facebook application: See Part 1

- (optional) A local or remote web server for implementing badge installers and adding update capabilities to the application.

User level

Beginning

Required products

  • Flash Builder (Download trial)

Sample files

  • flex45_fbgraph_pt1_endproject.zip
  • flex45_fbgraph_pt2_endproject.zip

Note: This tutorial series was updated September 2011 to use the Adobe ActionScript 3 SDK for Facebook Platform, which uses OAuth 2.0. Facebook is requiring all applications to use OAuth 2.0 by October 1, 2011.

This tutorial series steps you through the process of building and deploying either a desktop or web application that retrieves, displays, and posts Facebook data. In Part 1, you built a local Flex and Facebook desktop application with Flash Builder and the Adobe ActionScript 3 SDK for Facebook Platform. In Part 2, you package and deploy this application as an AIR desktop application. In the process you will:

  • Create and digitally sign an AIR file using Flash Builder.
  • Use the AIR runtime to install the application as a desktop application.
  • Create a native installer for a seamless desktop installation experience for the user.
  • Post the application to a web server.
  • Create a badge installer for seamless installation from a web page.
  • Add the ability for the application to be updated using the Adobe update framework.
  • Post an XML configuration file and an updated version of the application on a web server and then step through the end user process of updating the application.

Note: Facebook frequently changes to the site's user interface and API. This makes it difficult to keep this tutorial 100% up-to-date. Please be sure to add and read the comments at the end of this tutorial for any user interface or API modifications that might have occurred.

Package the AIR application

Start by modifying some of the application properties and then packaging it as an AIR file.

Open Flash Builder.

If you did not complete Part 1 of the tutorial series, you need to do the following:

  • Complete the Register an application with Facebook section of Part 1.
  • Download and unzip flex45_fbgraph_pt1_endproject.zip.
  • Import the FXP this ZIP contains into Flash Builder. In Flash Builder, select File > Import Flash Builder Project, browse to the FXP file, and then Click Finish.
  • In FacebookUserStatusAIR.mxml, replace the string YOUR APPLICATION ID HERE with the ID Facebook assigned to your application.

Modify application properties

Change the application ID used by the AIR runtime to uniquely identity the application and specify an application icon.

  1. Right-click FacebookUserStatusAIR-app.xml in the Package Explorer and select Open With > Text Editor.

    Every AIR application contains an application descriptor file which is used by the AIR runtime when installing and launching the application. It contains information about the application (like its name, id, description, file icons, and so on) and information about the initial operating system window to load the application SWF into when the application is launched (its size, position, and so on). See the AIR documentation for more details about the application descriptor file.

  2. Locate the id element and change it from FacebookUserStatusAIR to com.adobe.samples.FacebookUserStatusAIR. This ID is used by the AIR runtime to uniquely identify the AIR application. To guarantee a unique name, use reverse domain name notation as done here.
<id>com.adobe.samples.FacebookUserStatusAIR</id>
  1. Locate the name and filename elements and change them to Facebook User Status.
  2. Locate the icon element and uncomment it.
  3. Set each image subelement to the corresponding PNG file in the images folder.
<icon> <image16x16>images/fb_status_app_icon16.png</image16x16> <image32x32>images/fb_status_app_icon32.png</image32x32> <image48x48>images/fb_status_app_icon48.png</image48x48> <image128x128>images/fb_status_app_icon128.png</image128x128> </icon>
  1. Save the file.

Create an AIR file

Next, use the Flash Builder ADT (AIR Developer Tool) to package and sign the desktop application.

  1. Select Project > Export Release Build.
  2. In the Export Release Build dialog box, set the Project to FacebookUserStatusAIR, the Application to FacebookUserStatusAIR.mxml, the Export to AIR folder blank, the Base filename to FacebookUserStatusAIR, and export as a signed AIR package (see Figure 1).
Package the application as an AIR file.
Figure 1. Package the application as an AIR file.
  1. Click the Next button.
  2. In the Digital Signature screen of the Export Release Build dialog box, click the Create button (see Figure 2).
Sign the AIR application.
Figure 2. Sign the AIR application.

    You cannot package and distribute an AIR application withouta digital signature. The digital signature has two main purposes: to providesignificant assurance to your users that you are a trusted signer whose codewill not do anything malicious to their computers and that the application theyare installing has not been accidentally or maliciously altered since it waspackaged.

    AIR code-signing certificates are sold by a number ofcompanies, including ChosenSecurity, GlobalSign, Thawte, and Verisign;certificates are typically only sold to registered companies and the processincludes submittal and verification of multiple company documents. When youinstall an AIR application, the name of the publisher associated with a trustedcertificate is displayed in the installation dialog box. If you create your owncertificate as you are doing here, the publisher name is displayed as Unknown.In general, you should never install applications that have a publisher ofunknown (although many people do). Creating your own certificate is useful fordeveloping applications. As well, AIR still uses this self-signed certificate toverify that the AIR package has not been altered since it was signed. Refer tothe AIR documentation for more information about digitallysigning AIR applications.

  1. In the Create Self-Signed Digital Certificate dialog box, enter your name as the Publisher name, enter a password, confirm the password, set the type to 2048-RSA,v and then click Browse to navigate to a location to save the file and save it as YourLastName.p12 on your computer (see Figure 3).
Create a digital signature.
Figure 3. Create a digital signature.
  1. In the Create Self-Signed Digital Certificate dialog box, click OK.
  2. Back in the Digital Signature screen of the Export Release Build dialog box, select Remember password for this session, and uncheck Timestamp.
  3. Click the Package Contents button.
  4. On the Packaging Settings page, see that the AIR package will contain the SWF, the application descriptor file, and the icon images.
  5. Click Finish.
  6. Locate the AIR file in the Package Explorer (see Figure 4).
fig_04

Install the application from an AIR file

One way to distribute your application is to simply distribute this AIR file you just created. In order to install the application, however, the user must have the AIR runtime already installed and have the proper version needed to install this application. You are going to install the application using the AIR file right now as it is the simplest install process, but you will learn a better way to distribute the application using native installers and installation badges in the following sections.

  1. Unless you have done so already, download and install Adobe AIR. You need to have the AIR runtime installed before you install an AIR application.
  2. In Flash Builder, double-click the FacebookUserStatusAIR.air file in the Package Explorer to install it.
  3. In the Application Install dialog box, click Install (see Figure 5). Note that the Publisher says UNKNOWN because you self-signed the application and did not use a certificate purchased and verified by a company that issues code-signing certificates.
Install the application.
Figure 5. Install the application.
  1. On the Installation Preferences screen, click Continue. The application should be installed in the location you selected and should launch.
  2. Look at your task bar or dock; you should see the icon you specified for the application (see Figure 6).
Look at the application icon.
Figure 6. Look at the application icon.
  1. Navigate to your Application or Program Files directory. You should see your AIR application. On Windows, you can also find your application in the control panel and the Start menu.
  2. In the application window, click the login button and log in to Facebook. You should see your user information displayed as before (see Figure 7).
Run the application as a desktop application.
Figure 7. Run the application as a desktop application.
  1. Close the application.

Create a native installer to install from the desktop

To make sure the user has the right version of the AIR runtime installed before installing the application, you can create native or badge installers. Both check to make sure the correct version of the AIR runtime needed to run the application is installed before installing the application. If it is not, the required version of the AIR runtime is first downloaded and installed. In this section, you make a native installer to install from the desktop. In the next, you make a badge installer to install from a web page.

To create a native installer, you use the same ADT tool in Flash Builder that you just used to create the AIR file. You can only create a native installer for the operating system you are using. To create native installers for other operating systems, you need to install and use Flash Builder on each of those other operating systems.

  1. Select Project > Export Release Build.
  2. In the Export Release Build dialog box, set the Project to FacebookUserStatusAIR, the Application to FacebookUserStatusAIR.mxml, and select Signed native installer (see Figure 8).
Create a native installer for the application.
Figure 8. Create a native installer for the application.
  1. Click the Next button.
  2. On the Digital Signature page, make sure the certificate you previously created and its password are entered and click Finish.
  3. Locate the native installer in the Package Explorer (see Figure 9).
Locate the native installer.
Figure 9. Locate the native installer.
  1. Double-click the AIR file you created in the last section and in the Application Install window that opens, click Uninstall (see Figure 10), and then Finish.
Uninstall the application.
Figure 10. Uninstall the application.
  1. In Flash Builder, double-click the native installer file you just created and then step through the installation process for your operating system. For example, on a Mac, double-click the Install Facebook User Status icon (see Figure 11).
Install using the native installer.
Figure 11. Install using the native installer.

    If the user is online and does not have the required version of the AIR runtime installed, she will get a dialog box to grant permission to install the runtime (see Figure 12).

Get a dialog box for installing the AIR runtime.
Figure 12. Get a dialog box for installing the AIR runtime.

    If the user is offline, the AIR runtime cannot be downloaded so the user will instead get a message that she needs to install Adobe AIR before she can install the application (see Figure 13).

Get a message that the AIR runtime is required.
Figure 13. Get a message that the AIR runtime is required.
  1. Close the application.

Create a badge installer to install from a web page

You can create seamless installation experiences for users by creating and distributing native installers or by creating and deploying installation badges on web pages. Adobe provides an HTML template page for creating badge installers. All you need to do is edit this file and then deploy your badge along with the AIR file it references on a website. This badge allows for an image to be loaded into the button and for the color of the badge and the button to be changed.

Use an existing installation badge

First, use an existing installation badge to see how it works.

  1. In a browser window, go to the Tour de Flex.
  2. Click the installation badge (Install Now) for Tour the Flex in the upper right of the page (see Figure 14), and step through the installation process.
Install an application using a badge installer.
Figure 14. Install an application using a badge installer.

Place the AIR file on a web server

To create your own badge installer, the first thing you need to do to is to put your AIR file on a web server so you can specify a URL to download it from in the badge installer. You will place additional files on the web server in later steps.

  1. Place the AIR file on a local or remote web server.
  2. In a browser, browse to the URL for the AIR file, make sure the file can be successfully downloaded, and then copy the URL. You will paste this location into the badge HTML page shortly.

Create the badge HTML page

Next, modify the HTML template page for creating the badge installer.

  1. Navigate to the latest SDK folder in the Flash Builder install directory on your computer. An example location on a Mac would be /Applications/Adobe Flash Builder 4.5/sdks/4.5.1/ and on Windows C:\Program Files\Adobe\Adobe Flash Builder 4.5\sdks\4.5.1\.
  2. Open the /Adobe Flash Builder/sdks/x.x.x/samples/badge/ directory and look at the files it contains.
  3. The default_badge.html file is a template file for creating badge installers. You make changes to this file and then post it on your server or more typically, copy its HTML code and place it inside a web page on your website. The default_badge.html file references the badge.swf file and the AC_RunActiveContent.js files.

  4. Copy these three files: default_badge.html, badge.swf, and AC_RunActiveContent.js.
  5. Return to Flash Builder, right-click on the FacebookUserStatusAIR project in the Package Explorer, and select Paste. You should now see the files in your project (see Figure 15). You don't actually need to place the files in your project; it is just convenient for working on them and then deploying all the files to a web server.
Copy the badge installer files to your project.
Figure 15. Copy the badge installer files to your project.
  1. Right-click on the default_badge.html file and select Rename.
  2. In the Rename resource dialog box, enter a new name of fb_badge.html and then click OK.
  3. In the Package explorer, right-click on fb_badge.html and select Open With > Text Editor.
  4. Locate the title tag on line 4 and change the page title to Facebook User Status Application Installer Page.
<title>Facebook User Status Application Installer Page</title>
  1. Locate the required version properties on lines 25, 27, and 29 and change them to require Flash Player 10.2.0 (or whatever version is required by the SDK you are using).
// Major version of Flash required var requiredMajorVersion = 10; // Minor version of Flash required var requiredMinorVersion = 2; // Minor version of Flash required var requiredRevision = 0;
  1. Locate the flashvars variable on line 59 and change the appname, appurl, airversion, and imageurl variables to the appropriate values.
'flashvars','appname=Facebook%20User%20Status&appurl=http://stallons.com/facebook/userstatusAIR/FacebookUserStatusAIR.air&airversion=2.6&imageurl=fb_status_app_icon128.png',

    The appname is the name of the application that will be displayed in a message under the install button if the AIR runtime is not present.

    The appurl is the URL of the AIR file on the server. For appurl, use the URL for the location of your AIR file on your web server. You must use an absolute, not relative, URL.

    The airversion is the version of the AIR runtime required. Your application is using AIR 2. You can find this value in the FacebookUserStatusAIR-app.xml file.

    The imageurl is the URL of an image to display in the badge interface. For imageurl, you can specify a relative or absolute URL. Use the fb_status_app_icon128.png file in the project's images folder. In the code example above, a relative URL is specified and you just have to post this image file in the same directory as the HTML page.

    You can also specify some additional, optional variables. You can set buttoncolor to a six-digit hex value (or to transparent) to set the color of the button background and messagecolor to a six-digit hex value for setting color of the text message displayed under install button.

  1. On line 63, change the name of the application and the location of the AIR file.
document.write('<table id="AIRDownloadMessageTable"><tr><td>Download <a href="http://stallons.com/facebook/userstatusAIR/FacebookUserStatusAIR.air"> Facebook User Status</a> now.<br /><br />
  1. On line 91, change the name of the application and the location of the AIR file.
Download <a href="http://stallons.com/facebook/userstatusAIR/FacebookUserStatusAIR.air">Facebook User Status</a> now.<br /><br />
  1. Save the file.
  2. Copy the three badge files: fb_badge.html, badge.swf, and AC_RunActiveContent.js and place them on your web server.
  3. Copy the fb_status_app_icon128.png file from the src > images directory and place it in the same directory on your web server.
  4. Copy the AIR file and place it in the same directory on the web server.

Install from the badge

You are now ready to test the badge installation.

  1. In a browser, browse to the fb_badge.html file that you placed on your web server, for example, http://stallons.com/facebook/userstatusAIR/fb_badge.html. You should see a badge with the image you specified (see Figure 16).
Browse to the badge installer page on your web server.
Figure 16. Browse to the badge installer page on your web server.
  1. Click the badge.
  2. In the Application Install dialog box, click Open (see Figure 17).
Install the application from a badge installer.
Figure 17. Install the application from a badge installer.

    Because you already installed the application, you get the option to run, replace, or uninstall the application (see Figure 18).

  1. If you do not see an Uninstall button, click the More Options link at the bottom of the window and then you will see an Uninstall button (see Figure 18).
Uninstall or run an application already installed.
Figure 18. Uninstall or run an application already installed.
  1. Click Uninstall to uninstall the application so that you can then use the badge installer to reinstall it.
  2. Click the Finish button.
  3. Return to the browser and click the badge installer again.
  4. In the Application Install dialog box, click Open. If the user did not already have the required version of the AIR runtime installed, the AIR runtime would have first been downloaded and installed.
  5. On the installation confirmation screen, click Install.
  6. On the installation preferences screen, click Continue. The application should be installed in the location you selected and should launch just as it did when you installed directly from the AIR file or the native installer.
  7. Close the application.

Add update capability

Before you distribute a desktop application, you should build into it the ability to be updated in the future. The application needs a way to check and see if it should be updated and then have the ability to update itself (using the AIR runtime). In order to accomplish this, you need to add some logic to your application and put an XML file on your web server that has details for the latest version and location of the application. Your application checks this XML file periodically (whever you decide it should) to see if it needs be updated.

You add update logic to your application using an update framework created by Adobe that includes APIs and optional UI components for the update process. It provides the ability to periodically check for updates based on an interval or at the request of the user and to download AIR files (the updates) from a web server. It also provides information and messages to the user throughout the update process. You are going to use the default user interface provided with the framework in your application, but this interface can also be customized.

Create the update configuration files

You are going to create two configuration files. One will live on your web server and contains update information for your application including the latest version number and the URL for the corresponding AIR file. The other is a local file, part of the application itself, and contains information about how the update should occur including how often and where to retrieve info about the latest application version (the location of the first file on the web server).

  1. In Flash Builder, select File > New > Other and in the New dialog box, drill-down to General > Untitled Text File and click Finish.
  2. Add the following text to the file but replace the url value to point to a location on your web server. You will create this v2 AIR file shortly.
<?xml version="1.0" encoding="utf-8"?> <update xmlns="http://ns.adobe.com/air/framework/update/description/2.5"> <versionNumber>2.0.0</versionNumber> <url>http://stallons.com/facebook/userstatusAIR/FacebookUserStatusAIR_v2.air</url> <description>This is the latest version of the Facebook User Status application.</description> </update>
  1. Save the file as update.xml in the FacebookUserStatusAIR project.
  2. Move or copy this file to your web server.
  3. In Flash Builder, select File > New > Other and in the New dialog box, drill-down to General > Untitled Text File and click Finish.
  4. Add the following text to the file except set the url element to match the name and location of the file you just created and put on your server.
<?xml version="1.0" encoding="utf-8"?> <configuration xmlns="http://ns.adobe.com/air/framework/update/configuration/1.0"> <url>http://stallons.com/facebook/userstatusAIR/update.xml</url> <delay>1</delay> </configuration>

    The delay element sets the interval in days between periodic checks of new updates. The default value is 0 and means no periodic checks are done.

    This config file can also contain a defaultUI element to control which dialog boxes are displayed during the update process. See the AIR documentation for more details.

  1. Select File > Save As.
  2. In the Save As Dialog box, drill-down to FacebookUserStatusAIR > src, enter a file name of update_config.xml, and click OK. You should see the file in your project (see Figure 19).
Save the update-config.xml file in your project.
Figure 19. Save the update-config.xml file in your project.

Add update functionality

Now you need to add code to your application to use the update framework to check the update config file on the server to see if it needs to be updated.

  1. In the Package Explorer, expand the Flex 4.x branch and locate the applicationUpdater SWC files (see Figure 20).
  2. The applicationUpdater.swc includes the basic update functionality without any user interface. The applicationUpdater_ui.swc includes the basic functionality of the update library but also includes a user interface for displaying update options. You are going to use the API of the ApplicationUpdaterUI class (air.update.ApplicationUpdaterUI) to initialize the update process. For more details on using this class, peruse its API in the ActionScript 3 Reference.

Locate the AIR updater classes.
Figure 20. Locate the AIR updater classes.
  1. In the Package Explorer, collapse the Flex 4.x branch.
  2. Return to FacebookUserStatusAIR.mxml.
  3. Inside the Script block, declare a private variable called _appUpdater that is an instance of the ApplicationUpdaterUI class (air.update.ApplicationUpdaterUI). Be sure to choose ApplicationUpdaterUI from code-hinting so the import statement is written for you.
import air.update.ApplicationUpdaterUI; private var _appUpdater:ApplicationUpdaterUI = new ApplicationUpdaterUI();
  1. Inside the windowedapplication1_creationCompleteHandler() function, set the ApplicationUpdaterUI configurationFile property to the config file you created earlier in the data folder, update_config.xml.
_appUpdater.configurationFile = new File("app:/update_config.xml");

    The File class (flash.filesystem.File) is only available in desktop applications and an instance of it represents a directory or file on the user's computer. The app:/ refers to the application directory of the application, where the application was stored when it was installed. See the File class API in the ActionScript 3 Reference for more details.

  1. Still inside the windowedapplication1_creationCompleteHandler() function, call the initialize() method of the ApplicationUpdaterUI class. This method initializes the update framework and if the delay that was specified in the update_config.xml file has expired, it starts the update process. Otherwise it restarts the timer (which is managed by the AIR runtime).
_appUpdater.initialize();
  1. Inside the windowedapplication1_creationCompleteHandler() function, register to listen for the initialized event of the ApplicationUpdaterUI class (which is broadcast after the initialization is complete) and specify a handler updateInitializedHandler .
  2. You register to listen for events in ActionScript using the addEventListener() function. You pass to it the name of the event you want to listen for (like click or initialized in this case) and a reference to the function that will be the event handler. Instead of using the string "initialized" as the name of the event, use the static constant of the UpdateEvent class equal to this string.

    You can place the code before or after the initialize() call; code execution in Flash Player is single-threaded and the handler will never be invoked before all the code inside this function is executed. Be sure to select UpdateEvent form code-hinting so the import is written for you.

import air.update.events.UpdateEvent; protected function initApp():void { FacebookDesktop.init("YOUR APPLICATION ID HERE",loginHandler); _appUpdater.configurationFile = new File("app:/update_config.xml"); _appUpdater.initialize(); _appUpdater.addEventListener(UpdateEvent.INITIALIZED, updateInitializedHandler); }
  1. Inside the Script block, create a protected function updateInitializedHandler() that receives one argument of type UpdateEvent and returns nothing.
import air.update.events.UpdateEvent; protected function updateInitializedHandler(event:UpdateEvent):void{ }
  1. Inside the updateInitializedHandler() function, call the checkNow() method of the ApplicationUpdaterUI instance to start the update process and check for updates now
_appUpdater.checkNow();

    Normally, you would not need to execute any code once the updater is initialized. If the delay time has elapsed, the application will automatically check to see if it needs to be updated. In this case, however, the time will not have elapsed and we don't want to wait a day, so we are going to add code to check for updates now.

  1. Save the file and run the application. You should immediately get a Check for updates dialog box (see Figure 21).
Get a dialog box to check for application updates.
Figure 21. Get a dialog box to check for application updates.
  1. Click Check for Updates.
  2. In the Update available dialog box, click Download now. You will get an error message because you have not yet created and posted the v2 version of the AIR application. You will do this next.
  3. Click Close.
  4. Close the application.

Package and install the application with update capability

Next you need to package and install this new version of the application which now has update capabilities.

  1. Select Project > Export Release Build.
  2. In the Export release Build dialog box, export the FacebookUserStatusAIR project to FacebookUserStatusAIR_v1.air (see Figure 22).
Export the new version of the application.
Figure 22. Export the new version of the application.
  1. Click Next.
  2. On the Digital Signature page, make sure your certificate and password are correctly entered and click Next.
  3. On the Package Contents page, confirm that the update_config.xml file and the images will be included in the package (see Figure 23).
Make sure the update_config.xml file is included in the package.
Figure 23. Make sure the update_config.xml file is included in the package.
  1. Click Finish.
  2. In the Package Explorer, double-click the FacebookUserStatusAIR_v1.air file.
  3. In the Application Install dialog box, click Replace to replace the existing version with this new version that has update functionality (see Figure 24).
Replace the existing application with the new one that has update capability.
Figure 24. Replace the existing application with the new one that has update capability.
  1. Close the application.

Create, package, and post a new application version

Next, create a new version of the application to post to your web server. You are going to change the background color of the application in the new version so after the update process, you will be able to tell instantly that the application was updated.

  1. Open FacebookUserStatusAIR-app.xml.
  2. Locate the versionNumber node and change its value from 0.0.0 to 2.0.0.
<versionNumber>2.0.0</versionNumber>
  1. Save the file.
  2. Return to FacebookUserStatusAIR.mxml.
  3. In the WindowedApplication tag, add a backgroundColor and set it equal to light gray (#e7e7e7).
  4. Comment out the code inside the updateInitialized() function so the update check is not done every time the application is launched but instead by the delay you set in the update_config.xml file.
protected function updateInitializedHandler(event:UpdateEvent):void{ //_appUpdater.checkNow(); }
  1. Save the file.
  2. Select Project > Export Release Build.
  3. In the Export release Build dialog box, export the FacebookUserStatusAIR project to FacebookUserStatusAIR_v2.air.
  4. Click Finish.
  5. Post the FacebookUserStatusAIR _v2.air to your web server. Make sure its name and location match what you specified in the update.xml file.

Run the application and update it

Lastly, run the application and update it to the new version.

  1. In Flash Builder, double-click the FacebookUserStatusAIR _v1.air file to run the existing version of the application that was already installed.
  2. In the Application Install dialog box, click Run Now. The application still has a white background and you should get a Check for updates dialog box.
  3. Click Check for Updates.
  4. In the Update available dialog box, click Download now (see Figure 25).
Download the new version of the application.
Figure 25. Download the new version of the application.
  1. In the Install update dialog box, click Install now (see Figure 26).
Install the updated application.
Figure 26. Install the updated application.
  1. The updated application should launch and it should have the new gray background (see Figure 27).
See the updated application
Figure 27. See the updated application
  1. Close the application.

Where to go from here

In Part 2 of this tutorial series, you packaged and deployed your Flex and Facebook application as a desktop application. Specifically, you created and digitally signed an AIR file, packaged the application as a native installer, created and deployed a badge installer on a web server, and installed the application using all three. Finally, you added update capability to the application, created and deployed an updated version of the application, and tested the update mechanism.

To learn more about creating and customizing Flex applications, see the Flex documentation and the Adobe Flex Developer Center. To learn more about creating and customizing AIR applications, see the AIR documentation and the Adobe AIR Developer Center.

To deploy the application as an external web application, continue with Part 3 of the tutorial series, Modify and deploy as a web application.

To deploy the application as a web application on Facebook.com, continue with Part 4 of the tutorial series, Modify and deploy on Facebook.com.

More Like This

  • Create your first Flex and Facebook application – Part 3: Modify and deploy as a web application
  • Create your first Flex and Facebook application – Part 4: Modify and deploy on Facebook.com
  • Build your first Facebook application
  • The architecture of applications built on the Flash and Facebook Platforms
  • Create your first Flex and Facebook application – Introduction
  • Create your first Flex and Facebook application – Part 1: Build and test locally
  • The technologies for building applications on the Flash and Facebook Platforms

Tutorials and samples

Tutorials

  • Create your first Flex and Facebook application – Part 1
  • Create your first Flex and Facebook application – Introduction
  • Create your first Flex and Facebook application – Part 4

Samples

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement