Skip to content

Commit

Permalink
Version de test
Browse files Browse the repository at this point in the history
Ajout marshallException (no effect)
Utilisation d'un logger custom
Ajout d'un try/catch dans WebSocketMainInsecure

Compilation en mode Flash 11.1
  • Loading branch information
Clorr committed Mar 9, 2012
1 parent 84de1cf commit f1906ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/vendor/web-socket-js/flash-src/WebSocketMain.as
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class WebSocketMain extends Sprite implements IWebSocketLogger{
private var eventQueue:Array = [];

public function WebSocketMain() {
ExternalInterface.marshallExceptions = true;
ExternalInterface.addCallback("setCallerUrl", setCallerUrl);
ExternalInterface.addCallback("setDebug", setDebug);
ExternalInterface.addCallback("create", create);
Expand Down Expand Up @@ -56,12 +57,12 @@ public class WebSocketMain extends Sprite implements IWebSocketLogger{

public function log(message:String):void {
if (debug) {
ExternalInterface.call("WebSocket.__log", encodeURIComponent("[WebSocket] " + message));
ExternalInterface.call("customLogger", encodeURIComponent("[WebSocket log] " + message));
}
}

public function error(message:String):void {
ExternalInterface.call("WebSocket.__error", encodeURIComponent("[WebSocket] " + message));
ExternalInterface.call("customLogger", encodeURIComponent("[WebSocket err] " + message));
}

private function parseEvent(event:WebSocketEvent):Object {
Expand Down
10 changes: 8 additions & 2 deletions lib/vendor/web-socket-js/flash-src/WebSocketMainInsecure.as
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ import flash.system.*;
public class WebSocketMainInsecure extends WebSocketMain {

public function WebSocketMainInsecure() {
Security.allowDomain("*");
super();
try{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
super();
}catch(e:Error){
log("[WebSocket] exception levee");
log("[WebSocket] "+e);
}
}

}
Expand Down
2 changes: 1 addition & 1 deletion lib/vendor/web-socket-js/flash-src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# You need Flex 4 SDK:
# http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4

mxmlc -static-link-runtime-shared-libraries -target-player=10.0.0 -output=../WebSocketMain.swf WebSocketMain.as &&
mxmlc -static-link-runtime-shared-libraries -target-player=11.1 -output=../WebSocketMain.swf WebSocketMain.as &&
mxmlc -static-link-runtime-shared-libraries -output=../WebSocketMainInsecure.swf WebSocketMainInsecure.as &&
cd .. &&
zip WebSocketMainInsecure.zip WebSocketMainInsecure.swf &&
Expand Down

0 comments on commit f1906ac

Please sign in to comment.