You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, August 11th 2010, 6:38pm

Tricky XML include idea not working...

Hi,

I would like to include an XML file that is not embedded from one that is. What I want to do is leave the map xml exposed so the client can add their Google Map API key.

embedded:

Source code

1
main.xml ...<include url="map.xml" />...



external:

Source code

1
map.xml ...<plugin name="map"key="Endter your Google Maps API Key HERE!" ... >...</plugin>



But I'm not having much luck. I have not tried using full paths, since that would not work for my situation. I just wanted to ask if this is a setup someone has solved before I keep experimenting.

Not sure if this is a viable solution (I assume this would be equivalent to replacing the current XML rather than 'including') but I also tried adding doing a "krpano.loadxml(MapXML);" from a plugin swf but I get an error with that...
Error: Call to a possibly undefined method loadxml through a reference with static type krpano_as3_interface.


Any guidance or ideas would be greatly appreciated.

Thanks in advance!

This post has been edited 2 times, last edit by "wheller" (Aug 11th 2010, 11:37pm)


2

Wednesday, August 11th 2010, 11:42pm

Updated

If you tried to read this post before, the tags were not displaying in the code blocks... hopefully it makes more sense now.

3

Friday, August 13th 2010, 10:14am

Hi,

yes, that should work,
just make your project as you want it and then when building the swf with the kprotect remove the specific xml file from the embedded files list, it will be loaded the normal way,

internally krpano loading works like that:
1. first it looks up if there is an embedded file with the path/name
2. if not it tries to load the file the normal way

best regards,
Klaus

4

Friday, August 13th 2010, 9:54pm

Thanks Klaus!

Excellent, I got it working. Not sure what I did wrong the first time but I rebuilt the protected file and it worked perfectly.

Thank you for confirming I was on the right track, knowing I'm not going down the wrong path completely makes it much easier to experiment with different setups.

This is the first time I've used kprotect, and like all your other tools it's excellent.

-Bill

Similar threads