Skip to content

Commit

Permalink
Improve HTML5 loaderInfo.url
Browse files Browse the repository at this point in the history
  • Loading branch information
jgranick committed Feb 16, 2015
1 parent 950f9e1 commit 178fe3f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
8 changes: 7 additions & 1 deletion openfl/display/LoaderInfo.hx
Expand Up @@ -6,6 +6,10 @@ import openfl.events.UncaughtErrorEvents;
import openfl.system.ApplicationDomain;
import openfl.utils.ByteArray;

#if (js && html5)
import js.Browser;
#end


/**
* The LoaderInfo class provides information about a loaded SWF file or a
Expand Down Expand Up @@ -107,6 +111,8 @@ import openfl.utils.ByteArray;
class LoaderInfo extends EventDispatcher {


private static var __rootURL = #if (js && html5) Browser.document.URL #else "" #end;

/**
* When an external SWF file is loaded, all ActionScript 3.0 definitions
* contained in the loaded class are stored in the
Expand Down Expand Up @@ -399,7 +405,7 @@ class LoaderInfo extends EventDispatcher {

} else {

loaderInfo.url = "";
loaderInfo.url = __rootURL;

}

Expand Down
2 changes: 0 additions & 2 deletions openfl/display/MovieClip.hx
Expand Up @@ -130,8 +130,6 @@ class MovieClip extends Sprite {
__totalFrames = 0;
enabled = true;

loaderInfo = LoaderInfo.create (null);

}


Expand Down
1 change: 1 addition & 0 deletions openfl/display/Sprite.hx
Expand Up @@ -105,6 +105,7 @@ class Sprite extends DisplayObjectContainer {

buttonMode = false;
useHandCursor = true;
loaderInfo = LoaderInfo.create (null);

}

Expand Down

0 comments on commit 178fe3f

Please sign in to comment.