PDA

View Full Version : JavaScript control of panorama?


Corvus
05-10-2007, 11:52 AM
Hi Denis -

flashpanoramas looks really interesting, and seems to be the most flexible and capable Flash pano player I've seen. At some point I might be interested in migrating our virtual tours from QTVR to Flash, but I'd need a solution that can accommodate the features we currently use.

One of these is JavaScript control of the panorama to pan, tilt and zoom to a particular location. Does flashpanoramas permit JavaScript to read & write these values so that you can animate the panorama via JS?

Many thanks.

Denis
05-14-2007, 10:01 AM
Yes. The player has ExternalInterface API to control any parameter outside and run any Hotspots script commands.

This is a HTML piece of code from externalTest.html example (you can find it in Flash Panorama Player package):
<input name="Left" type="button" id="Left" value="Left" onClick="window.document.pano.myidPanoExecute('pano.pan-=20,100')" /><input name="Right" type="button" id="Right" value="Right" onClick="window.document.pano.myidPanoExecute('pano.pan+=20 ,100')" />
(creates two html buttons for left-right smooth rotation)

Some browsers block javascript-Flash communications for offline mode (security restrictions), but it should work ok for online html pages.

ExternalInterface works for:
Internet Explorer 5.0 and later
Netscape 8.0 and later
Mozilla 1.7.5 and later
Firefox 1.0 and later
Safari 1.3 and later

hamoid
05-14-2007, 12:08 PM
Congratulations for your awesome panorama player! I'm surprised to find such a flexible software, well supported... great!

My question: In the example I see "pano.pan". Is there a list of such variables we can control?

Is it possible to dynamically add and remove hotspots?