Forums: Flash:

 

getURL and www

first
 

JERKSTORE getURL and www

I've got a couple of sites that I just noticed a problem with.
Each of these sites has a main nav that is built in flash, on an otherwise html page (not my favorite setup, but the client really wanted a flash nav).

On one site, I'm using some variables set via the swfObject method on the page to pass the contents of the nav and their urls to link to into the movie. On the other site, the nav info lives in an XML file that flash loads. On both, the urls provided for the buttons to link to are absolute and include "http://www..."

The problem, which I just noticed, is that if you visit either site without the w w w in the url, the flash buttons don't seem to do anything when you click. If you visit with the w w w in the url, they work fine.

I installed a crossdomain.xml policy file on both urls, specifying the url with both the w w w and without, but the buttons still fail to activate their getURL commands when visited on the non-w w w domains.


<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="www.domain.com" />
<allow-access-from domain="domain.com" />
</cross-domain-policy>


I don't actually have to tell flash to look for that policy file, do I? It should just check automatically in the root of the domain it's on (which is where the .swfs are)?

Can anyone think of something else that could be causing this?

 

JLM

Two issues I have come across recently.

1)
Flash player 9 revision 115 and updates to flash players 7 and 8 introduce a tighter security model that seems to effect getURL where the page is changed when the paths of the swf and the replacement content are not exactly the same, send the info to the html's javascript using the externalInterface and do the getURL that way. Test by downloading the uninstaller and getting older versions of the flash player ie ver 47 and get the debug versions.
Firefox may tell you of the issue but IE7 fails silently.

2)
Newer safari's do not treat ../ when in root as the same as root.

You can use charles or httpheaders or something to see some of the communication and if it fails etc..

 

JERKSTORE

I'm not calling a javascript function via the nav. And this happens to me in all browsers, not just Safari, so I don't think it's an issue of Safari misidentifying the root.

I'm simply passing it an absolute url I want it to pull up, like "http://www.domain.com/section/"
So I'm not sure why this works when I'm currently on "www.domain.com" but not when I'm there without the w w w.

It seems ridiculous that I would have to use externalInterface to call a function to load the url rather than being able to just load it from inside the flash movie.

Maybe I'm not understanding what it is you're saying.

What seems completely ridiculous to me is that I can launch an external link (say to Amazon) in a new window from this flash nav, but if I want to just link to a different page on the same domain, but on a different subdomain (w w w versus no w w w) then flash just balks and seemingly ignores the request.

 

JERKSTORE

And I'm not attempting to load my XML file or other external data into flash from a different subdomain. All of my requests inside of flash are relative, and working.

But I am unable to have getURL reload the page if the link involves a different subdomain than the one the flash movie is currently on.

That seems like a pretty worthless "security" feature to me...

 

JERKSTORE

Okay, problem solved.

On each of these sites, I'm using some mod_rewrite action to form pretty urls. And so to accomplish that, I have to set the base href in the document head. I was setting my base hrefs to the url with the "www" which worked fine when the user approached the site that way, but flash didn't like it without.

By changing the base href to be set dynamically via php:


<base href="http://<?=$_SERVER[HTTP_HOST]?>/"></base>


I no longer run into that problem. It's weird, I didn't have to dynamically set the host in my urls given to flash - Flash is fine so long as the base href matches the current subdomain, even if the links out from flash are to a different subdomain.

smile

 

perumal getURL and non-www issue

Hi Jerkstore,

I am have the same problem with flash, like the one you had. I replaced the base href tag as you said but still i am having the issue is not fixed. Any other suggestion will be helpful.

thank you,
-Perumal


 

JERKSTORE

Perumal, what does your code look like?

 

JLM

Flash is only going to get tighter send the command to javascript.

 

JERKSTORE

Listen to JLM - he knows more about this stuff than I do big grin

 
first
 

Forums: Flash: getURL and www

 
New Post
 
You must be logged in to post