views:

891

answers:

2

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();
}
+1  A: 

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.

grapefrukt
I am using flex 3.0 SDK. I know i am missing of UpdateEvent Class. How can i get it ?
Devesh M
i updated my answer with a download link for the latest sdk
grapefrukt
thanks...its working
Devesh M
+1  A: 

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.

Brian Hodge
http://blog.hodgedev.com

Brian Hodge