Sie sind nicht angemeldet.

1

Montag, 9. März 2009, 22:24

FlashVars to Plugin

Hi,

Just trying to read flashvars from the krpano.swf embed (not the plugin embed in the xml file) inside a plugin.

Part of the krpano SWFObject:

Quellcode

1
2
3
        	var so = new SWFObject("krpano.swf", "krpanoSWFObject", "100%", "100%", "9.0.28","#000000");
        	so.addVariable("id", "23");
        	so.addVariable("panoId", "40");


And my AS3 plugin snippet:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);


function loaderComplete(myEvent:Event) {
	
	var myQueryStrings = root.loaderInfo.parameters;
	
	if(myQueryStrings.sid)
	{
		sid = myQueryStrings.sid;
	}
	if(myQueryStrings.id)
	{
		tourId = myQueryStrings.id;
	}
	if(myQueryStrings.panoId)
	{
		panoId = myQueryStrings.panoId;
	}
}


Quellcode

1
	krpano.trace(0, "panoId: " + panoId);

traces panoId: null

Any idea, how I can retrieve the flashvars within a plugin swf?

Thanks.

P

2

Dienstag, 10. März 2009, 00:58

Resolved

Quellcode

1
var myQueryStrings = this.parent.loaderInfo.parameters;


Instead of root use this.parent to retrieve flashvars from the main mc (krpano.swf) within a plugin .swf file.

3

Dienstag, 10. März 2009, 21:58

right! the root object is not the real starting/loading object in krpano!
you can also use "stage.loaderInfo.parameters"

Ähnliche Themen