2 * Based on the expressinstall.as class created by Geoff Stearns as part
\r
3 * of the FlashObject library.
\r
5 * Use this file to invoke the Macromedia Flash Player Express Install functionality
\r
6 * This file is intended for use with the FlashObject embed script. You can download FlashObject
\r
7 * and this file at the following URL: http://blog.deconcept.com/flashobject/
\r
10 * var ExpressInstall = new ExpressInstall();
\r
12 * // test to see if install is needed:
\r
13 * if (ExpressInstall.needsUpdate) { // returns true if update is needed
\r
14 * ExpressInstall.init(); // starts the update
\r
17 * NOTE: Your Flash movie must be at least 214px by 137px in order to use ExpressInstall.
\r
21 class ExpressInstall{
\r
22 public var needsUpdate:Boolean;
\r
23 private var updater:MovieClip;
\r
24 private var hold:MovieClip;
\r
26 public function ExpressInstall(){
\r
27 // does the user need to update?
\r
28 this.needsUpdate = (_root.MMplayerType == undefined) ? false : true;
\r
31 public function init():Void{
\r
35 public function loadUpdater():Void{
\r
36 System.security.allowDomain("fpdownload.macromedia.com");
\r
38 // hope that nothing is at a depth of 10000000, you can change this depth if needed, but you want
\r
39 // it to be on top of your content if you have any stuff on the first frame
\r
40 this.updater = _root.createEmptyMovieClip("expressInstallHolder", 10000000);
\r
42 // register the callback so we know if they cancel or there is an error
\r
44 this.updater.installStatus = _self.onInstallStatus;
\r
45 this.hold = this.updater.createEmptyMovieClip("hold", 1);
\r
47 // can't use movieClipLoader because it has to work in 6.0.65
\r
48 this.updater.onEnterFrame = function():Void {
\r
49 if(typeof this.hold.startUpdate == 'function'){
\r
50 _self.initUpdater();
\r
51 this.onEnterFrame = null;
\r
55 var cacheBuster:Number = Math.random();
\r
57 this.hold.loadMovie("http://fpdownload.macromedia.com/pub/flashplayer/"
\r
58 +"update/current/swf/autoUpdater.swf?"+ cacheBuster);
\r
61 private function initUpdater():Void{
\r
62 this.hold.redirectURL = _root.MMredirectURL;
\r
63 this.hold.MMplayerType = _root.MMplayerType;
\r
64 this.hold.MMdoctitle = _root.MMdoctitle;
\r
65 this.hold.startUpdate();
\r
68 public function onInstallStatus(msg):Void{
\r
69 getURL("javascript:dojox.flash.install._onInstallStatus('"+msg+"')");
\r