This commit is contained in:
2014-04-02 14:12:10 +04:00
parent 22fdf93d2b
commit a37f7f5c3d

View File

@@ -69,8 +69,16 @@ class BaseLoader<T> implements ILoader<T> {
if (StringTools.startsWith(url, "%assets%")) { if (StringTools.startsWith(url, "%assets%")) {
var path:String = url.substring(9); var path:String = url.substring(9);
var bytes:ByteArray = openfl.Assets.getBytes(path); var bytes:ByteArray = openfl.Assets.getBytes(path);
if (bytes == null) {
Timer.delay(function() {
var c:ICallback<T> = callback;
dispose();
c.callFail("Bytes is null for asset: " + path);
}, 1);
} else {
return fromBytes(bytes); return fromBytes(bytes);
} }
}
#end #end
return request(url, URLRequestMethod.GET, data); return request(url, URLRequestMethod.GET, data);
} }