Devesh M
Devesh M

Reputation: 1033

auto update in flex application

I am using auto update in my flex application using the updater framework. I got this article and followed the same steps.

http://blog.multimediacollege.be/2008/12/using-the-air-15-updater-framework-in-flex/#

But i'm getting an error and can't understand the reason:

1046: Type was not found or was not a compile-time constant: UpdateEvent.

import flash.events.ErrorEvent;
import air.update.ApplicationUpdaterUI;
import air.update.events.UpdateEvent; 
import mx.controls.Alert;

private var appUpdater:ApplicationUpdaterUI = new ApplicationUpdaterUI();

private function checkForUpdates():void {
    appUpdater.configurationFile = new File("app:/updateConfig.xml");
    appUpdater.isCheckForUpdateVisible = false;
    appUpdater.addEventListener(UpdateEvent.INITIALIZED,updaterInitialised);
    appUpdater.initialize();
}

private function updaterInitialised(event:UpdateEvent):void {
    appUpdater.checkNow();
}

Upvotes: 2

Views: 2042

Answers (2)

Brian Hodge
Brian Hodge

Reputation: 2135

You say you have the flex 3.0 SDK in your comment to grapefruit; download the latest, flex 3.3 sdk, extract it and tell flex where you put the sdk. I personally use flash develop, all I do is add the ApplicationUpdater_ui.swc to the project and the package becomes available.

  • The swc file is in flex _sdk _3/frameworks/lib/air/. Once the swc is part of your library you will have UpdateEvent as well as the rest of the framework available.

The flex framework comes with all the necessary elements to create AIR apps, including the update framework.

Upvotes: 1

grapefrukt
grapefrukt

Reputation: 27045

I haven't used this specific functionality, but since you are missing the UpdateEvent class at compile time I would suspect you aren't compiling for Air 1.5.

This should be resolved if you get the latest version of the SDK from Adobe.

Upvotes: 1

Related Questions