PDA

View Full Version : loadPano(nature.swf?xml_file=nature.xml ???


christophe
03-28-2007, 04:24 PM
Hello Denis,

Congratulation for your work !

Just a question, do you know why this snippet doesn't works ?
loadPano(nature.swf?xml_file=nature.xml) (loads panorama with a new parameters file)

Here is my own :
<?xml version="1.0" ?>
<panorama>
<parameters>

layer_5 = hotspots.swf

</parameters>
<hotspots>
<global onLoad="change:-,alpha,0.5,200; change:-,scaleX,1,300; change:-,scaleY,1,300;" onStart=" pano.sensitivity=40;pano.friction=0.88; pano.threshold=0.000001;pano.pan=25,300,smooth; pano.tilt=-5,300,smooth; change:1,visible,0; change:2,visible,0; change:3,visible,0; change:6,visible,1; change:4,visible,0; change:5,visible,0;">

[...]

onClick="loadPano(escalier4.swf?xml_file=SaM.xml)
change:3,visible,0;
change:1,visible,1
change:2,visible,1;
change:4,visible,1;
change:5,visible,1;
change:6,visible,0;"
/>

I would like to have the same sensitivity, etc, as the first pano after the next pano is loaded.

I thought it was the good way but it seems that no ! :cry:

Denis
03-29-2007, 03:37 PM
Looks ok.
Gime me a link, I can check it with debugger.
You can debug it yourself (read the last chapter of Hotspots tutorial how to debug your panorama).
And better use new Hotspots syntax, the old one works for now, but will be disabled in future versions.

christophe
03-29-2007, 11:35 PM
Very big thanks Denis......it's such easier to create hotspots now with new version !

Easier but it still doesn't works, even after debug !

Maybe you could see something here that going wrong in the flashlog.txt :
Load 0: SaM_f.jpg
Load 1: SaM_r.jpg
Load 2: SaM_b.jpg
Load 3: SaM_l.jpg
Load 4: SaM_u.jpg
Load 5: SaM_d.jpg
Load layer 5: hotspots.swf
Load spot 6: logogauche.png
Execute global: pano.sensitivity=40
Execute global: pano.friction=0.88
Execute global: pano.threshold=0.000001
Execute global: pano.pan=25,300,smooth
Execute global: pano.tilt=-5,300,smooth
Execute 6: alpha=1
Execute 6: alpha=0.3
Execute 6: alpha=1
Execute 6: loadPano(escalier4.swf?xml_file=SaM.xml)
Execute 6: alpha=0.3
Load 0: escalier4_f.jpg
Load 1: escalier4_r.jpg
Load 2: escalier4_b.jpg
Load 3: escalier4_l.jpg
Load 4: escalier4_u.jpg
Load 5: escalier4_d.jpg
Layer 5 is busy
Unload hotspot 6
Load spot 1: logogauche.png
Load spot 2: logodroite.png
Load spot 4: pancarte.jpg
Load spot 5: pancarte2.jpg
Execute 4: alpha=0
Execute 5: alpha=0
Execute 1: alpha=1
Execute 1: alpha=0.3
Execute 1: alpha=1
Execute 1: alpha=0.3
Execute 2: alpha=1
Execute 2: alpha=0.3



And here is my new xml code :
<?xml version="1.0" ?>
<panorama>
<parameters>
layer_5 = hotspots.swf
</parameters>
<hotspots>
<global onStart=" pano.sensitivity=40;pano.friction=0.88; pano.threshold=0.000001;pano.pan=25,300,smooth; pano.tilt=-5,300,smooth;">
<spot id="1" url="logogauche.png" alpha="0.3" onOver="alpha=1" onOut="alpha=0.3" pan="160" tilt="0" linked="escalier4" onClick="loadPano(chambre.swf?xml_file=SaM.xml);"/>
<spot id="2" url="logodroite.png" alpha="0.3" onOver="alpha=1" onOut="alpha=0.3" pan="120" tilt="-44" linked="escalier4" onClick="loadPano(SaM.swf?xml_file=SaM.xml);"/>

<spot id="3" url="logogauche.png" alpha="0.3" onOver="alpha=1" onOut="alpha=0.3" pan="-130" tilt="0" linked="chambre" onClick="loadPano(escalier4.swf?xml_file=SaM.xml);"/>


<spot id="4" scaleX="0.5" scaleY="0.5" url="pancarte.jpg" pan="-62" tilt="4" linked="escalier4"
onLoad="alpha=0;"
onOver="alpha=1,100; change:-,scaleX,1,200; change:-,scaleY,1,200;"
onOut="alpha=0,300; change:-,scaleX,0.2,700, bounce; change:-,scaleY,0.2,700, bounce;"/>


<spot id="5" scaleX="0.5" scaleY="0.5" url="pancarte2.jpg" pan="-20" tilt="4" linked="escalier4"
onLoad="alpha=0;"
onOver="alpha=1,100; change:-,scaleX,1,200; change:-,scaleY,1,200;"
onOut="alpha=0,300; change:-,scaleX,0.2,700, bounce; change:-,scaleY,0.2,700, bounce;"/>


<spot id="6" url="logogauche.png" alpha="0.3" onOver="alpha=1" onOut="alpha=0.3" pan="-82" tilt="0" linked="SaM" onClick="loadPano(escalier4.swf?xml_file=SaM.xml);"/>
</global>
</hotspots>
</panorama>

the second pano doesn't turn as the first one !

if you wanna test it in real, here is the link : http://www.enterview.fr/chambre/cadalen.htm

Thanx for your help !

Christophe

Denis
03-30-2007, 06:54 AM
Oh. I see.
"linked" ignores uppercase letters, but panoName does not. This is my bug, I will change the algorithm of comparison to fix it in the next version.
Currently you can change loadPano(SaM.swf?xml_file=SaM.xml); to loadPano(sam.swf?xml_file=SaM.xml); or better to loadPano(sam.swf); (your SaM.xml does nothing so has no new info).

About rotation params you can
1. copy your onStart=" pano.sensitivity=40;pano.friction=0.88; pano.threshold=0.000001" to onTransitionEnd=" pano.sensitivity=40;pano.friction=0.88; pano.threshold=0.000001. This will call changing of rotation params for every new panorama (not only for the firt one).
2. Most direct way. Make pano tag to make a template for every panorama: <pano friction="0.88" sensitivity="40" threshold="0.000001" />
Use onStart and onTransitionEnd to make the initial smooth transition:
<global onStart="setPosition1()"
setPosition1="pano.pan=25,300; pano.tilt=-5,300"
setPosition2="pano.pan=-25,300; pano.tilt=5,300"
>
<pano friction="0.88" sensitivity="40" threshold="0.000001" />
<spot id="1" onClick="
loadPano(chambre.swf);
onTransitionEnd=setPosition2();
" />
<spot id="2" onClick="
loadPano(sam.swf);
onTransitionEnd=setPosition1();
" />
</global>

By the way, I like the combination of friction="0.88" and sensitivity="40" you found, I recomend it for all. :)

christophe
03-30-2007, 04:09 PM
A very big thanx Denis !

For your reactivity, your help and all your work !

Just a last thing (I hope),
loadPano(chambre.swf?pan=-90)
doesn't works. I mean the pan is not changing after the loaded pano

jaaaab
03-30-2007, 05:19 PM
c'est coquet chez toi christophe ;)

christophe
03-30-2007, 06:37 PM
:wink:

jaaaab
03-30-2007, 06:42 PM
c'est coquet chez toi christophe ;)

Denis
03-31-2007, 06:25 AM
A very big thanx Denis !

For your reactivity, your help and all your work !

Just a last thing (I hope),
loadPano(chambre.swf?pan=-90)
doesn't works. I mean the pan is not changing after the loaded pano

Because panorama player has no pan value. Pano has panHome value :) http://flashpanoramas.com/player/parameters

You can change pano.pan=-90 pano2.pan=-90 inside Hotspots environment, but only when pano object is created, say, using onNewPano event.

viktor-y
04-02-2007, 11:27 PM
Hi Denis,

First of all Congratulation I really like these new features although the Canaan will be when the player can load swf faces.
But now I’ve got a problem. It was quite hard to implement a complex flash button (without any AS knowledge) but finally it's been working fine till this moment.
Can you tell me what’s the problem with this code that I can't use with the new player:
hotspot.onRelease = function(){
_lc.send(masterSlot, "loadPano", ["hall.swf", "-", "fade", 1000]);
}

Thank you!

Denis
04-04-2007, 08:15 PM
LocalConnection API has no more "loadPano" function (I gave a notice about beta status of this command! :) )

The correct code is:
_lc.send(masterSlot, "execute", "loadPano(hall.swf,3000,stripes);");
(read tutorials/hotspots_LC_API.html)

I think it's even more simple, you can execute any Hotspots command like this.

viktor-y
04-05-2007, 01:09 AM
Thank you Denis. I’ve tried this code as well. Unfortunately it didn’t work. Her is all my code I used, can you have a look what did I miss? Many Thx


// Use the same name in spots.xml: <hotspots controller="hotspots_lc">
// Better use different controller names for different panoramas
var controllerName = "hotspots_lc";

// Master slot name:
var masterSlot:String;

// Slave slot name:
var slaveSlot:String;

// Begin of connection code (better use it as is).
var dumpSlot = controllerName+"_dump_"+random(1000000);
var _lc = new LocalConnection();
_lc.allowDomain = function () {
return true; // allow all connections
}
_lc.connect(dumpSlot);
_lc.onStatus = function(info) {
if (info.level == "error") {
trace("No master connection detected.");
_lc.close();
delete _lc;
}
};
_lc.setSlot = function(slot) {
masterSlot = controllerName+"_master_"+slot;
slaveSlot = controllerName+"_slave_"+slot+"_"+random(1000000);
_lc.close();
_lc.connect(slaveSlot);
trace("set slave: "+slaveSlot);
startWatch();
};
_lc.send(controllerName+"_master_0", "getSlot", dumpSlot);
// end of connecion code

var panoName:String; // current pano name
var panoBusy:Boolean; // true if panorama is loading or a transition effect is in process
var iid:Number; // interval id

// start watching parameters "panoName" and "panoBusy":
function startWatch () {
iid = setInterval(this, "sendQuery", 500);
}

// send query:
function sendQuery () {
// 3rd argument is array of askable parameters, 4th and 5th are connection name and function to callback
_lc.send(masterSlot, "getParams", ["pano.panoName","pano2.panoName"], slaveSlot, "callback");
}

// listener function:
_lc.callback = function(values) {
// store panoName
panoName = values[1] != null ? values[1] : values[0];
// if the second panorama is not null, set busy flag:
panoBusy = values[1] != null;
};

hotspot.onEnterFrame = function(){
if(rewind == true){
hotspot.prevFrame();
}
}
hotspot.onRollOver = function(){
rewind = false;
hotspot.play();
}
hotspot.onRollOut = function(){
rewind = true;
}
hotspot.onRelease = function(){
_lc.send(masterSlot, "execute", "loadPano(hall.swf,1000,fade);");
}

Denis
04-17-2007, 04:09 AM
Can't see any bug in this code. Check code in controller.fla example with a similar call, does it work?

viktor-y
04-20-2007, 11:51 PM
Hi Denis,

Thx for your replay, I’ve checked and realized what was the problem. I used stripe panorama instead of 6 cube faces. Could you tell me what shall I change to make it work with stripe panorama as well? Thx

Denis
04-21-2007, 12:01 AM
Stripes parsed into cube faces in loading process. I don't know any differences in woking with stripes and cubes...

viktor-y
04-23-2007, 01:05 PM
Hi Denis

I’ve found out what was the problem. After a couple of try my folder was a big mess and I forget that my first pano was with 6 cube faces. So it seams that you can’t mix the two pano type. Thx for your help.