PDA

View Full Version : Is it possible to control panorama via Javascript?


hyung
02-13-2008, 04:04 AM
Hi,

I wish to turn my pano to fullscreen mode by clicking an image
which is placed outside panorama. I remember this was possible
with ImmerVision's PurePlayerPro. PurePlayerPro allowed communication
between Javascript and PurePlayerPro.

I wonder if this is also possible in FPP? I have only seen examples
that call Javascript functions from panorama. I want to control my
panos from outside of the panorama and I cannot find any example.

Can someone tell if this possible?

Regards,

Hyung

discocandy
02-13-2008, 05:15 AM
I am absolutly no pro.
but I think it is possible when you call on the swf right away and give the xml the same name. in your xml you can write to open full screen. don't shoot me when I am wrong..:D
but that is what popped into my head

hyung
02-13-2008, 06:09 AM
Hi discocandy,

Thanks for your reply but I did not understand correctly.. Is your method
based on ActionScript? I have no experience of Flash, ActionScript.

I know only a bit of HTML & Javascript.

I found one example of Denis

http://flashpanoramas.com/blog/2007/05/23/add-some-life-to-panoramas/

If you see the text, you can see hyperlinked parts such as "the display",
"the wall clock", "the photos on the table".. I viewed the source of this
page and found out that it is actually possible to control panoramas via
Javascript. Here is the Javascript code that Denis has written:


function checkPano20() {
if (window.document.movie20==null) {
alert("Update your Flash Player plugin.");return false;
}
if (window.document.movie20.livePanoExecute==null) {
alert("Load the panorama at firts.");return false;
}
return true;
}
function showClock() {
if (!checkPano20()) return;
window.document.movie20.livePanoExecute("pano.qualityStatic=low;pano.pan=-15.9,2000,elastic;pano.tilt=6.4,3000,elastic;pano. zoom=2.5,1000,-,restoreQuality;")
}
function showCamera() {
if (!checkPano20()) return;
window.document.movie20.livePanoExecute("vid.url=images/camera.swf")
}
function hideCamera() {
if (!checkPano20()) return;
window.document.movie20.livePanoExecute("vid.url=images/abeauty.swf")
}
function showVideo() {
if (!checkPano20()) return;
window.document.movie20.livePanoExecute("pano.qualityStatic=low;pano.pan=31.9,3000,elastic; pano.tilt=-10,1000;pano.zoom=1.5,1000,smooth,restoreQuality;")
}
function showPhotos() {
if (!checkPano20()) return;
window.document.movie20.livePanoExecute("pano.qualityStatic=low;pano.pan=-55,4000,elastic;pano.tilt=-30,2100,elastic;pano.zoom=1,2000,elastic,restoreQu ality;")
}

"movie20" is the id of the panorama and "livePanoExecute" seems to be
the key.. I tried to run this code on my machine but this "livePanoExecute"
doesn't work.

I have just looked at the .xml source code and found "externalInterfaceID"
and it's value is "live". Maybe this has something to do with Javascript
communication.

I will give it a try and let you know the result.

Hyung

hyung
02-13-2008, 06:42 AM
I should have referred to the FPP example "Panorama with ExternalInterface
Controller". It is possible to control panorama via Javascript EXCEPT! turning
the pano to fullscreen mode. Refer to the following remark:

You can address any value provided by Hotspot plugin (read Hotspots tutorial) and run any function, except fullscreen() command; for security restrictions Flash Player allows fullscreen mode switch only if user clicks the mouse inside the target Flash movie.

Hyung