PDA

View Full Version : Why does xml loading deactivate nav buttons?


bloupi
08-24-2007, 07:36 AM
Hi all

If I load a xml file in embedPano example :

panorama.loadPanorama("pano.swf?panoName=images/panoA & xml_file=params/panoA.xml&");

all navigation buttons are deactivated. Why this ? Do I have to add or remove code in :
left_btn.addEventListener(MouseEvent.MOUSE_DOWN, doLeft); etc...?

Thanks for your help

Philippe

jaaaab
08-24-2007, 08:56 AM
hi

are you sure your second xml file contains also the xml navigation code?

i mean the code of the buttons that dissapear.

++

bloupi
08-24-2007, 05:47 PM
are you sure your second xml file contains also the xml navigation code?

++

Hi Jaaaab

Thanks (again) for your response... you were right ! I've learnt a little more with tutorials and I can now use hotspots. Unfortunately a problem follows another one : in my embedded presentation, when I click on a thumbnail (or when the pano is auto-loaded as in the Denis example) it loads fine with buttons and all. But when I click on a 2nd thumbnail, the pano seems to load (I see rapidly the percentage growing) but the pano frame is empty and I can't click any more in the player. I've spent half a day trying all combination but I' can't go further. What is wrong ? (All works fine without xml files solution but very simple presentation)

Here is my code in embedded player:
_____________________________________________
var panorama:MovieClip;
var loader:Loader = new Loader();
loader.load(new URLRequest("files/pano.swf"));
addChild(loader);

loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, loadComplete);

function loadComplete (e:Event) {
swapChildren(loader, border);
panorama = loader.content;
panorama.setArea(190,38,320,240);
panorama.loadPanorama("pano.swf?xml_file=images/panoA.xml&");

pano1_btn.addEventListener(MouseEvent.CLICK, doPano1);
pano2_btn.addEventListener(MouseEvent.CLICK, doPano2);
}

function doPano1 (e:Event)
{
panorama.pano.remove();
if (panorama.pano.loadCompleted) {
panorama.loadPanorama("pano.swf?xml_file=images/panoA.xml&");
}
}
function doPano2 (e:Event) {
if (panorama.pano.loadCompleted) {
panorama.pano.remove();
panorama.loadPanorama("pano.swf?xml_file=images/panoB.xml&");
}
}
_____________________________________

and xml file for PanoA...
_____________________________________
<?xml version="1.0" ?>
<panorama>
<parameters>
panoName=http://www.mydomain.fr/panoramas/images/panoA
(the embedded player is in folder /panoramas/ )

qualityStatic=medium
qualityMotion=low

zoomMax=4
zoomMin=0.45
zoomHome=0.87
panHome=-204
tiltHome=-13


layer_1 = files/autorotator.swf
layer_2 = files/hotspots.swf
</parameters>

<autorotator>
speed = -0.1
interval = 30
pause = 500
quality = medium
</autorotator>

<hotspots>
<global
...(hotspots definitions)...
</global>
</hotspots>
</panorama>

jaaaab
08-25-2007, 10:22 AM
hi

Can you explain me why you have to load another xml file?

Cause if it is just in intend to change the pano and not the nav buttons, you don't have to, jujst pass a new panoName or a loadpano action and the pano will change, no need to chge th whole xml

Cheers.

bloupi
08-25-2007, 03:28 PM
hi
(...)Cause if it is just in intend to change the pano and not the nav buttons, you don't have to, jujst pass a new panoName or a loadpano action and the pano will change, no need to chge th whole xml
Cheers.
Hi Jaaaab,
Many thanks for your response. I did what you said:
- 1rst pano called with xml file (with buttons)
panorama.loadPanorama("pano.swf?panoName=panos/panoA&xml_file=panos/panoA.xml&");

- other panos called with :
panorama.loadPanorama("pano.swf?panoName=panos/panoB");

and I get an error :
Load 0: panos/panoA_f.jpg
Load 1: panos/panoA_r.jpg
Load 2: panos/panoA_b.jpg
Load 3: panos/panoA_l.jpg
Load 4: panos/panoA_u.jpg
Load 5: panos/panoA_d.jpg
ArgumentError: Error #2025: Le DisplayObject must be a child of the "caller" (translated from french).
at flash.display:: DisplayObjectContainer/swapChildren()
at Hotspots/panoCreated()
at hotspots_fla::MainTimeline/newPano()
at PanoController/::initPanorama()
at PanoController/loadPanorama()
at F_fla::MainTimeline/doPano2()

Only the first called pano is mounted. The next ones do not appear, (but buttons stay in an empty pano area)

Moreover, I've tried to pass hotspots parameters in panorama.loadPanorama command, but I get errors asking for rightparen and rightbrace before "external". It seems that there is a special syntax for hotspots parameters and it's very hard (for me) to find the right way.

panorama.loadPanorama("pano.swf?xml_txt=<panorama><parameters>panoName=panos/panoA;layer_1=files/autorotator.swf;layer_2 = files/hotspots.swf</parameters><autorotator>speed = -0.1;interval = 30;pause = 500;quality = medium</autorotator><hotspots><global onStart="external.autorotator.disabled=1";onLoad="scale=0.5,500,elastic;depth+=20";onOver="scale=0.7,300,elastic;depth+=20"onOut="scale=0.5,300;depth-=20"> <spot id="left"static="1"salign="BC"staticX="-80.5"staticY="-20.5"url="boutA-l.png"blockMouse="1"; onPress="pano.panKey=-2,500";onRelease="pano.panKey=0"/></global></hotspots></panorama>");

Syntax is OK until <hotspots> but after, if I do what it is asked for, the final error is that there is too much characters at the end of the program.

I don't know if I'll see the end of this problem...

Thank for your help

Philippe