Created
July 17, 2009 17:40
-
-
Save srohde/149188 to your computer and use it in GitHub Desktop.
UpdateController
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import com.aupeo.wiat.view.UpdateWindow; | |
import mx.core.Window; | |
import org.swizframework.Swiz; | |
import org.swizframework.desktop.ISwizUpdateBean; | |
import org.swizframework.desktop.UpdateEvent; | |
public class UpdateController | |
{ | |
private var updateWindow:Window; | |
[Autowire(id="swizUpdateBean")] | |
public function set updateBean(bean:ISwizUpdateBean):void | |
{ | |
bean.addEventListener(UpdateEvent.VERSION_INFO, function(e:UpdateEvent):void | |
{ | |
if(e.updateInfo.localVersion != e.updateInfo.remoteVersion) | |
{ | |
updateWindow = new UpdateWindow(); | |
Swiz.getInstance().registerWindow(updateWindow); | |
updateWindow.open(); | |
updateWindow.move(50, 50); | |
} | |
}); | |
bean.addEventListener(UpdateEvent.UPDATE, function(e:UpdateEvent):void | |
{ | |
e.preventDefault(); | |
}); | |
} | |
public function UpdateController() | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment