View Full Version : How to move pano after loading
Scott Witte
09-16-2007, 01:19 AM
I'm stymied (again :( )
I can load and position a new pano just fine. But I can 't figure out how to automatically reposition it after it finishes loading. loadPano doesn't offer a "donefunction" nor do custom functions. How might I approach this?
Essentially what I want to do is:
onClick="pano.qualityStatic=low;pano.pan= -153.00,600; pano.tilt=14.00,600;pano.zoom=2,1000,,move2"
move2="loadPano(?panoName=Images/U_Gall_Fr&panHome= 109,600,fade); [and when finished call move3]"
move3="pano.pan=-44,300,,move4"
move4="pano.qualityStatic=best" />
Thanks!
clodomi
09-16-2007, 10:50 AM
Hello Scott
I don't know how to do, but did you see this :
http://flashpanoramas.com/blog/2006/12/27/hotspot-example-review/
Maybe it will help you :???:
Claude
jaaaab
09-16-2007, 02:37 PM
Yes there is a "done" function after a panos is loaded, it's called "onTransitionEnd", just have a look to the doc ;)
Regards.
Scott Witte
09-16-2007, 06:08 PM
Yes there is a "done" function after a panos is loaded, it's called "onTransitionEnd", just have a look to the doc ;)
Jaaaab,
Thanks. I should have mentioned that I struggled with onTransitionEnd for some time and concluded it couldn't call a function inside a spot object dynamically. However, I may have been doing it wrong.
The relevant code would look like this (removing most extranious code):
<global onTransitionEnd="move3" >
<spot id="Rec_UGall" .....
onClick="pano.qualityStatic=low;pano.zoom=2,1000,,move2"
move2="loadPano(?panoName=Images/UGal&panHome=150,600,fade)"
move3="pano.pan=-44,300,,move4"
move4="pano.qualityStatic=best" />
</global>
By my understanding onTransitionEnd can only appear in the <global> tag so can only be defined once. But the function it calls is different with each pano. (it can have the same name but each pano will have a different movement.) So i defined that funtion (move3) within each spot object. How do I get onTransitionEnd to call my function?
BTW, I tried move3() and adding onTransitionStart="" to the global tag. Neither helped. Or maybe my approach was wrong?
Claude,
Thanks for the link. I had read that partially but with all the syntax changes I wasn't sure how relevant it still was. Maybe it is worth another read. I didn't notice anything about how to execute something automatically after loading a pano.
jaaaab
09-16-2007, 06:31 PM
hi
you can easily redefine onTransitionEnd out of the <global> tag:
just write: global.onTransitionEnd=yourNewFunction();
and it will call the new attributed function ;)
Regards.
Scott Witte
09-16-2007, 08:21 PM
you can easily redefine onTransitionEnd out of the <global> tag:
just write: global.onTransitionEnd=yourNewFunction();
and it will call the new attributed function ;)
Brilliant! Thanks Jaaaab.
Here is what worked:
<spot id="Rec_UGall" ...
onClick="pano.qualityStatic=low;pano.pan= -153.00,600,,move2"
move2="loadPano(?panoName=Images/U_Gall_Fr&panHome= 100,600,fade);global.onTransitionEnd=Rec_UGall.mov e3"
move3="global.onTransitionEnd=;pano.qualityStatic=low;pan o.pan=-44,600,,qualityBest"
qualityBest="pano.qualityStatic=best"/>
A couple things I learned in the process:
You need not define onTransitionEnd in the global object, but if you don't you must proceed it with "global."
Any custom function it calls needs to be defined in the global object unless you specifically say otherwise, in the above case by proceeding the function name with the spot object name, even though the function is within the spot object it is being called from.
You must to turn off onTransitionEnd or it will apply to all future pano transitions. "global.onTransitionEnd=;" does this.
This certainly works. But it doesn't feel very elegant, IMO.
Again, much thanks, Jaaaab!
jaaaab
09-16-2007, 09:29 PM
that's the way it works!
you're welcome
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.