1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
|
From: Christian Welzel <gawain@camlann.de>
Subject: Port ActionScript-1 code to ActionScript-2 for mtasc
Origin: http://code.google.com/p/swfobject/issues/detail?id=233
Description: Debian policy requires all packages in main to be compiled
with tools in main. For compiling ActionScript code there is only mtasc
available. But mtasc can only process ActionScript 2 code. So this patch
ports the upstream AS1 code to AS2 code to allow to compile it with mtasc.
The patch was orignally written by a guy named Kyle and published in the
mentioned origin.
--- libjs-swfobject-2.2.orig/src/expressInstall.as
+++ libjs-swfobject-2.2/src/expressInstall.as
@@ -1,70 +1,87 @@
-/* SWFObject v2.2 <http://code.google.com/p/swfobject/> is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
- Express Install Copyright (c) 2007-2008 Adobe Systems Incorporated and its licensors. All Rights Reserved.
-*/
-
-System.security.allowDomain("fpdownload.macromedia.com");
-
-var time = 0;
-var timeOut = 5; // in seconds
-var delay = 10; // in milliseconds
-var int_id = setInterval(checkLoaded, delay);
-var old_si = null;
-var loaderClip = this.createEmptyMovieClip("loaderClip", 0);
-var updateSWF = "http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?" + Math.random();
-loaderClip.loadMovie(updateSWF);
-
-function checkLoaded(){
- time += delay / 1000;
- if (time > timeOut) {
- // updater did not load in time, abort load and force alternative content
- clearInterval(int_id);
- loaderClip.unloadMovie();
- loadTimeOut();
+/* SWFObject v2.2 <http://code.google.com/p/swfobject/> is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+ Express Install Copyright (c) 2007-2008 Adobe Systems Incorporated and its licensors. All Rights Reserved.
+*/
+
+class expressInstall {
+ static var app;
+
+ var time = 0;
+ var timeOut = 5; // in seconds
+ var delay = 10; // in milliseconds
+ var int_id = 0;
+ var old_si = null;
+ var loaderClip = null;
+
+ function expressInstall() {
+ System.security.allowDomain("fpdownload.macromedia.com");
+ var cacheBuster = Math.random();
+ var updateSWF = "http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+cacheBuster;
+ int_id = setInterval(this,"checkLoaded",delay);
+ loaderClip = _root.createEmptyMovieClip("loaderClip",0);
+ loaderClip.loadMovie(updateSWF);
+ _root.installStatus = installStatus;
}
- else if (loaderClip.startInstall.toString() == "[type Function]") {
- // updater has loaded successfully AND has determined that it can do the express install
- if (old_si == null) {
- old_si = loaderClip.startInstall;
- loaderClip.startInstall = function() {
- clearInterval(int_id);
- old_si();
- }
- loadComplete();
- }
- }
-}
-
-function loadTimeOut() {
- callbackSWFObject();
-}
-
-function callbackSWFObject() {
- getURL("javascript:swfobject.expressInstallCallback();");
-}
-
-function loadComplete() {
- loaderClip.redirectURL = _level0.MMredirectURL;
- loaderClip.MMplayerType = _level0.MMplayerType;
- loaderClip.MMdoctitle = _level0.MMdoctitle;
- loaderClip.startUpdate();
-}
-
-function installStatus(statusValue) {
- switch (statusValue) {
- case "Download.Complete":
- // Installation is complete.
- // In most cases the browser window that this SWF is hosted in will be closed by the installer or otherwise it has to be closed manually by the end user.
- // The Adobe Flash installer will attempt to reopen the browser window and reload the page containing the SWF.
- break;
- case "Download.Cancelled":
- // The end user chose "NO" when prompted to install the new player.
- // By default the SWFObject callback function is called to force alternative content.
- callbackSWFObject();
- break;
- case "Download.Failed":
- // The end user failed to download the installer due to a network failure.
- // By default the SWFObject callback function is called to force alternative content.
- callbackSWFObject();
- break;
- }
-}
+
+ function checkLoaded(){
+ time += delay / 1000;
+ if (time > timeOut) {
+ // updater did not load in time, abort load and force alternative content
+ clearInterval(int_id);
+ loaderClip.unloadMovie();
+ loadTimeOut();
+ }
+ else if (loaderClip.startInstall.toString() == "[type Function]") {
+ // updater has loaded successfully AND has determined that it can do the express install
+ if (old_si == null) {
+ old_si = loaderClip.startInstall;
+ loaderClip.startInstall = new_startInstall;
+ loadComplete();
+ }
+ }
+ }
+
+ function new_startInstall() {
+ clearInterval(app.int_id);
+ app.old_si();
+ }
+
+ function loadTimeOut() {
+ callbackSWFObject();
+ }
+
+ function callbackSWFObject() {
+ getURL("javascript:swfobject.expressInstallCallback();");
+ }
+
+ function loadComplete() {
+ loaderClip.redirectURL = _root.MMredirectURL;
+ loaderClip.MMplayerType = _root.MMplayerType;
+ loaderClip.MMdoctitle = _root.MMdoctitle;
+ loaderClip.startUpdate();
+ }
+
+ function installStatus(statusValue) {
+ switch (statusValue) {
+ case "Download.Complete":
+ // Installation is complete.
+ // In most cases the browser window that this SWF is hosted in will be closed by the installer or otherwise it has to be closed manually by the end user.
+ // The Adobe Flash installer will attempt to reopen the browser window and reload the page containing the SWF.
+ break;
+ case "Download.Cancelled":
+ // The end user chose "NO" when prompted to install the new player.
+ // By default the SWFObject callback function is called to force alternative content.
+ app.callbackSWFObject();
+ break;
+ case "Download.Failed":
+ // The end user failed to download the installer due to a network failure.
+ // By default the SWFObject callback function is called to force alternative content.
+ app.callbackSWFObject();
+ break;
+ }
+ }
+
+ static function main() {
+ app = new expressInstall();
+ }
+}
+
\ No newline at end of file
|