Curious, why do you want to load the url?
I tested it in my javascript interface, and I get the url, so it works. But you can read the krpano xml with xml.content
Loading a xml thats already loaded by krpano, is a bit of wasted resources :) Alsoo xml.url get's the url of the panorama, so if you include xml, that will not be shown. Another downside to xml.url is, you get the path which is relative to krpano.swf, which isnt the path the plugin needs to load the xml.
So my advice, use xml.content
Btw this is the code which works for me:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
import krpano_as3_interface;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
var krpano : krpano_as3_interface = null;
if (stage == null)
{
// plugin startup
addEventListener(Event.ADDED_TO_STAGE, startplugin);
addEventListener(Event.REMOVED_FROM_STAGE, stopplugin);
}
function startplugin(event:Event):void
{
// now start
krpano = krpano_as3_interface.getInstance();
var xml_url:String = krpano.get('xml.url');
krpano.call("trace("+xml_url+")");
krpano.call("trace(get(xml.content))");
var xmlrequest:URLRequest = new URLRequest(xml_url);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.load(xmlrequest);
}
function stopplugin(event:Event):void
{
// remove plugins events
krpano = null;
}
function loadComplete(evt:Event):void {
var xml:XML = new XML(evt.target.data);
krpano.call("trace("+xml+")");
}
|