PDA

View Full Version : XML & EmbedPano problem


viking0
11-19-2007, 02:23 AM
Hi

I have a problem first I load a panorama with his xml file, then when I want to load a new panorama with a new xml, it loads the previews xml file and not the new one.
xml files :
-pano1.xml
-pano2.xml

images:
-pano/pano1
-pano/pano2


everything fine here

panorama.loadPanorama("panoName=pano/pano1&xml_file=xml/pano1.xml");

it loads pano 1 images & pano1 xml file

then


panorama.externals.hotspots.loadPano(["panoName=pano/pano2&xml_file=xml/pano2.xml"])


but it loads pano1.xml instead pano2.xml

possibles solutions that didn't work

panorama.externals.hotspots.hotspots_obj.execute("loadPano(?panoName=pano/pano2&xml_file=xml/pano2.xml)")


or just

panorama.loadPanorama("xml_file=xml/pano2.xml");


and xml code


<global
onStart = "loadMain();"
loadMain = "loadPano(panoName=pano/pano2,50);"
>


but always re-load the first XML file,

any ideas?

Thanks.

zleifr
11-19-2007, 03:42 AM
this one looks promising to me:
hotspots.hotspots_obj.execute("loadPano(?panoName=pano/pano2&xml_file=xml/pano2.xml)")

what happens if you change it to:
hotspots.hotspots_obj.execute("loadPano(?panoName=pano/pano2&xml_file=xml/pano2.xml&)")

viking0
11-19-2007, 05:21 AM
you are the best, it works now, thank you man!

also I have another question maybe you know the solution
it's about events and hotspots


panorama.externals.hotspots.addEventListener(Mouse Event.MOUSE_DOWN, executehotspots );

function executehotspots (event:MouseEvent) {
trace(event.target.name)
}


that's the most close I can get to identify a hotspot, it returns the dynamic instance name example "instance58" do you know if is it possible to get the id name?
(sorry my english)

thanks a lot.

viking0
11-19-2007, 05:51 AM
I have been looking the tooltips, they are amazing

I got the solution looking at the source code.

trace(event.target.attributes.getParam("id"));


it returns the id name

thank you :)

swirl
12-12-2007, 04:19 PM
Hi!

I have a problem. I have some different xml file (with php extension).
This is my code:

var panorama:MovieClip;
var loader:Loader = new Loader();
loader.load(new URLRequest("pano.swf"));
addChild(loader);
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, loadComplete);
function loadComplete(e:Event) {
panorama = loader.content;
panorama.setArea(0,0,438,250); pannorama.loadPanorama("pano.swf?panoName=images_embedpano/nature&xml_file=&xml_file=pano1.php");
}
function reload(mit,id) {
if (panorama.pano.loadCompleted) {
var test = panorama.externals.hotspots.getChildAt(0);
test.execute("loadPano(?panoName=images_embedpano/"+mit+"&xml_file=pano"+Math.floor(Math.random()*3)+".php&)");
}
}

So, if I call the "reload" function with good parameters, the picture change, but the hotspots stay always.
In pano1.php, and pano2.php are the hotspots in different places. What's the problem? Thanks!

(sorry my english)