XML file: refer to files and images by URL?

Hi all,

is it possible to refer to images or layer SWFs by using http URLs? This would allow hosting panoramas on different hosts as well as sharing them throughout mutliple sites.

Example:

<PanoSalado>
        <layer id="PanoSalado" url="http://myhost.com/mypano/PanoSalado.swf">
        ...

as well as

<cube id="myPanoCubeFaces">
        <file id="front">http://myhost.com/path/to/myCubeFace_f.jpg</file>
        ...

Regards,
Michael

re: PanoSalado XML file: refer to files and images by URL?

Hi Michael:

Have you tried it?

You will probably need to install a cross-domain policy file in order to have Flash reliably load things cross-domain. Search Adobe's info for cross-domain policy files, if you're unfamiliar with them.

Cheers,

Patrick

__________________

Patrick Cheatham
FlashPanos.com creator, Panoramic Photographer
Got PanoSalado?

Cross domain issue too.

I had actually had some correspondence with patrick about this and it looks like something has changed about AS3 that it does not default check a policy file...Im trying to add this line to ModuleLoader.as but I get compiler errors....it seems anything I compile from rev_128 doesnt work. Even when compiling unedited source.

System.security.loadPolicyFile("http://othersite.com/crossdomain.xml");

Hi !! I've got the same

Hi !! I've got the same problem and does this solution work ?? I've tried in different ways but it doesn't work for me ...
Do you have any suggestions ? Can we give in xml file different domains for .swf and .jpg ?

Thanks for your answer.

Mike

Cross-domain loading of images into a PanoSalado virtual tour

Hey Mike:

This example just posted here is using fully qualified URLs to pass SWF/JPG to PanoSalado.

--

If you're experiencing difficulties with cross-domain referencing/delivery, your best bet will be to read up on Adobe's help & knowledge base topics regarding it.

Using a simple example from Adobe's help article, I created a short PHP file to act as a proxy ("proxy.php"). I modified this example to get the Web URL of the panorama image file via GET. To wit:

PHP:

 
$dataURL =      $_GET['panofile'];

//note that this will not follow redirects
readfile($dataURL);

I created a two-node virtual tour, with one node being local and one node being on another site. I put  proxy.php in with my PanoSalado tour files. Then I modified the PanoSalado.xml as follows below; You can see where the panorama which lives on another server is being passed through the  proxy.php first. When you test this, please use your own Web servers and images, not mine. Smile

Working, live example (use the dropdown menu to navigate between local and external panoramas).

XML:

 
<space id="defaultSpace" label="same-server" interactive="false" preciseOnAcceleration="true" preciseOnDeceleration="true" preciseAtRest="true" smoothOnAcceleration="true" smoothOnDeceleration="true" smoothAtRest="true" precisionOnAcceleration="12" precisionOnDeceleration="6" precisionAtRest="1" cameraRetainsLastValues="false">
        <cube id="pano_1" segments="16">
          <file face="front">files/Panos/files_000/default.jpg</file>
          <file face="right">files/Panos/files_000/default.jpg</file>
          <file face="back">files/Panos/files_000/default.jpg</file>
          <file face="left">files/Panos/files_000/default.jpg</file>
          <file face="top">files/Panos/files_000/default.jpg</file>
          <file face="bottom">files/Panos/files_000/default.jpg</file>
        </cube>
      </space>
      <space id="space.0" label="cross-domain" interactive="false" preciseOnAcceleration="true" preciseOnDeceleration="true" preciseAtRest="true" smoothOnAcceleration="true" smoothOnDeceleration="true" smoothAtRest="true" precisionOnAcceleration="12" precisionOnDeceleration="6" precisionAtRest="1" cameraRetainsLastValues="false">
        <cube id="pano.0" segments="16">
          <file face="front">files/proxy.php?panofile=http://www.cheathamlane.net/files/_demotours/_dogfood/images/Concert_1-sm_f.jpg</file>
          <file face="right">files/proxy.php?panofile=http://www.cheathamlane.net/files/_demotours/_dogfood/images/Concert_1-sm_r.jpg</file>
          <file face="back">files/proxy.php?panofile=http://www.cheathamlane.net/files/_demotours/_dogfood/images/Concert_1-sm_b.jpg</file>
          <file face="left">files/proxy.php?panofile=http://www.cheathamlane.net/files/_demotours/_dogfood/images/Concert_1-sm_l.jpg</file>
          <file face="top">files/proxy.php?panofile=http://www.cheathamlane.net/files/_demotours/_dogfood/images/Concert_1-sm_u.jpg</file>
          <file face="bottom">files/proxy.php?panofile=http://www.cheathamlane.net/files/_demotours/_dogfood/images/Concert_1-sm_d.jpg</file>
        </cube>
      </space>
 

This is a quick and dirty solution, and you need to muck about in PHP/ASP, what have you... Reading up on and following Adobe's best practices for cross-domain sharing of content will be your best route. Smile

Hope this helps!

Patrick

__________________

Patrick Cheatham
FlashPanos.com creator, Panoramic Photographer
Got PanoSalado?

Thank you !

Thank you Patrick for this answer ! I will test it quickly.

It works !

Thank you again Patrick, it works very well. A last question : in Adobe's doc Loading data across domains (http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16520&slice...), they talk about a second method, the "Shim SWF method".
Have you already tested it ?

re:Cross-domain loading of images into a PanoSalado virtual tour

mikedename wrote:

Thank you again Patrick, it works very well. A last question : in Adobe's doc Loading data across domains (http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16520&slice...), they talk about a second method, the "Shim SWF method".
Have you already tested it ?

Good news!

I haven't tested the "shim swf" method specifically for this scenario, but have used that method before. It's not particularly applicable here, since you need to pass JPG or PNG data to PanoSalado -- which a SWF isn't going to do without a lot of coding.

Cheers,

Patrick

__________________

Patrick Cheatham
FlashPanos.com creator, Panoramic Photographer
Got PanoSalado?