apinstein
12-03-2007, 04:04 PM
I have integrated FPP with my virtual tour hosting project, and am using javascript "callouts" to integrate FPP with my web page.
This allows me to change the pano shown in FPP via javascript with:
function flashpanoloader(isPreview)
{
isPreview = isPreview || false;
var flashpanoString = null;
if (isPreview)
{
flashpanoString = allMediaInfo[currentIndex]['small']['panoStringFlash'];
}
else
{
flashpanoString = getVirtualTourFlashPanoString(currentIndex);
}
window.document['flashpano'].fppPanoExecute( "loadPano(" + flashpanoString + ", 100)" );
}
In my XML setup, I need to call this function onStart, and this works fine:
<hotspots>
<global ExternalInterfaceID="fpp"
onStart="javascript:flashpanoloader();"
>
</global>
</hotspots>
However, I also want to use the fast preview loader from the example, and changed my XML file to:
<hotspots>
<global ExternalInterfaceID="fpp"
onStart="loadPreview();"
loadPreview="
javascript:flashpanoloader(true);
onTransitionEnd=loadMain();
"
loadMain="
javascript:flashpanoloader();
onTransitionEnd=
"
>
</global>
</hotspots>
This fails every time with a javascript error: loadMain is not defined.
It seems that the "javascript:" keyword has made the ENTIRE loadPreview be interpreted as javascript, instead of just that one line...
Actually, typing this out just gave me the idea to move the onTransitionEnd= line ABOVE the javascript:, and that works!
<hotspots>
<global ExternalInterfaceID="fpp"
onStart="loadPreview();"
loadPreview="
onTransitionEnd=loadMain();
javascript:flashpanoloader(true);
"
loadMain="
onTransitionEnd=
javascript:flashpanoloader();
"
>
</global>
</hotspots>
However, I still would like to understand, is there a way I can turn "off" the javascript call? At some point I may need to mix & match javascript in a way that would require this... something like:
loadPreview="
javascript:flashpanoloader(true);
flashpano:onTransitionEnd=loadMain();
"
Does that syntax exist somewhere?
This allows me to change the pano shown in FPP via javascript with:
function flashpanoloader(isPreview)
{
isPreview = isPreview || false;
var flashpanoString = null;
if (isPreview)
{
flashpanoString = allMediaInfo[currentIndex]['small']['panoStringFlash'];
}
else
{
flashpanoString = getVirtualTourFlashPanoString(currentIndex);
}
window.document['flashpano'].fppPanoExecute( "loadPano(" + flashpanoString + ", 100)" );
}
In my XML setup, I need to call this function onStart, and this works fine:
<hotspots>
<global ExternalInterfaceID="fpp"
onStart="javascript:flashpanoloader();"
>
</global>
</hotspots>
However, I also want to use the fast preview loader from the example, and changed my XML file to:
<hotspots>
<global ExternalInterfaceID="fpp"
onStart="loadPreview();"
loadPreview="
javascript:flashpanoloader(true);
onTransitionEnd=loadMain();
"
loadMain="
javascript:flashpanoloader();
onTransitionEnd=
"
>
</global>
</hotspots>
This fails every time with a javascript error: loadMain is not defined.
It seems that the "javascript:" keyword has made the ENTIRE loadPreview be interpreted as javascript, instead of just that one line...
Actually, typing this out just gave me the idea to move the onTransitionEnd= line ABOVE the javascript:, and that works!
<hotspots>
<global ExternalInterfaceID="fpp"
onStart="loadPreview();"
loadPreview="
onTransitionEnd=loadMain();
javascript:flashpanoloader(true);
"
loadMain="
onTransitionEnd=
javascript:flashpanoloader();
"
>
</global>
</hotspots>
However, I still would like to understand, is there a way I can turn "off" the javascript call? At some point I may need to mix & match javascript in a way that would require this... something like:
loadPreview="
javascript:flashpanoloader(true);
flashpano:onTransitionEnd=loadMain();
"
Does that syntax exist somewhere?