Skip to content

Commit

Permalink
IEでswfがキャッシュされている場合の対応
Browse files Browse the repository at this point in the history
  • Loading branch information
nihen committed Sep 6, 2010
1 parent 7998e3f commit 25b0663
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
7 changes: 0 additions & 7 deletions as/JSocket.as
Expand Up @@ -14,13 +14,6 @@ package {
private static var handlers:Object;

public function JSocket():void {
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}

private function init(e:Event = null):void {
removeEventListener(Event.ADDED_TO_STAGE, init);

ExternalInterface.addCallback('newsocket', newsocket);
ExternalInterface.addCallback('connect', connect);
ExternalInterface.addCallback('write', write);
Expand Down
13 changes: 10 additions & 3 deletions js/jsocket.js
Expand Up @@ -34,9 +34,9 @@
function JSocket() {
this.initialize.apply(this, arguments);
}
JSocket.VERSION = '0.03';
JSocket.VERSION = '0.04';
JSocket.init = function(src, swfloadedcb) {
JSocket.flashapi = $('<div></div>').prependTo('body').flashembed({
JSocket.flashapi = $('<div id="swfsocketdiv"></div>').prependTo('body').flashembed({
id: 'socketswf',
name: 'socketswf',
src: src.concat('?'.concat(JSocket.VERSION)),
Expand All @@ -47,7 +47,14 @@ JSocket.init = function(src, swfloadedcb) {
bgcolor: '#ffffff',
allowScriptAccess: 'always'
}).data('flashembed').getApi();
JSocket.swfloadedcb = swfloadedcb;

if ( JSocket.flashapi.newsocket ) {
// for IE(because already construct)
swfloadedcb();
}
else {
JSocket.swfloadedcb = swfloadedcb;
}
};
JSocket.swfloaded = function() {
if ( JSocket.swfloadedcb ) {
Expand Down
Binary file modified swf/JSocket.swf
Binary file not shown.

0 comments on commit 25b0663

Please sign in to comment.