openfl / openfl

The Open Flash Library for creative expression on the web, desktop, mobile and consoles.
http://www.openfl.org
MIT License
1.9k stars 430 forks source link

Bug? #33

Closed cjmxp closed 11 years ago

cjmxp commented 11 years ago

package io.nme.samples.nyancat;

import flash.display.Sprite; import flash.display.Loader; import flash.events.Event; import flash.net.URLRequest; import flash.Lib; import openfl.Assets;

class NyanCat extends Sprite { private var loade:Loader;

public function new () {

    super ();
    loade=new Loader();
    loade.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
    loade.load(new URLRequest("test.swf"));

}
private function onComplete(e:Event):Void
{
    trace("==",loade.contentLoaderInfo.applicationDomain);// print   ==,null
}

} //=========================================================== package io.nme.samples.nyancat;

import flash.display.Sprite; import flash.display.Loader; import flash.events.Event; import flash.net.URLRequest; import flash.Lib; import openfl.Assets;

class NyanCat extends Sprite { private var loade:Loader;

public function new () {

    super ();
    loade=new Loader();
    loade.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
    loade.load(new URLRequest("test.swf"));

}
private function onComplete(e:Event):Void
{
    trace(loade.contentLoaderInfo.applicationDomain);
}

}

/*

Source/io/nme/samples/nyancat/NyanCat.hx:25: characters 8-49 : flash.display.Loa derInfo has no field applicationDomain

*/

Beeblerox commented 11 years ago

@cjmxp applicationDomain isn't implemented on non-flash targets

jgranick commented 11 years ago

I've added applicationDomain to LoaderInfo, to help more of your code cross-compile. HTML5 and C++ don't support multiple ApplicationDomains, but I believe the code should still work consistently now.