WHen you run locally, you don't have a domain name so special sandbox
rules let you get away with cross-domain access.
 
Once deployed, the sandbox rules come into play.  a.b.com is a different
domain than d.b.com and I think from b.com as well and I think you'll
need crossdomain files at the root of all of those places.
 
You may need to re-read the doc on LocalConnection to make sure you are
using it correctly.  I don't think allowInsecureDomain matters unless
HTTPS is in play.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of enginefloor
Sent: Wednesday, October 03, 2007 11:48 AM
To: [email protected]
Subject: [flexcoders] LocalConnection: problems in IE, embedded pages



Hi,

I have a Flash8 player/projector which I've embedded in a Flex2 app.
The Flash8 player (f8.swf), is basically a movie player, and the point
of embedding it in the Flex2 app is so that you can see a variety of
movies through Flex, and then pick the one you want to show up in the
player (repeatedly). This works using LocalConnection to communicate
from Flex2 to Flash8.

I've built my app so that it does everything I want, but now that I'm
trying to deploy it I'm running into some problems. Everything about
the app appears to work fine, except for the LocalConnection, which
only seems to work in Firefox, and under certain conditions. In IE, I
can't change videos at all, and the "sample video", which is hardcoded
in the f8 player to load up on load, only loads up when you go to
site.com and not www.site.com. For whatever reason, going to
www.site.com or site.com affects whether the program works under
Firefox, even though I believe I've enabled all domains for all
features (see below).

I've also enabled popups under IE and Firefox. I haven't gotten
LocalConnection to work at all in IE. I have no idea why this is
happening. Any help would be appreciated.

Here's a readout of what works where (app.html is the wrapper
generated by Flex).
"OK" mean everything works fine:

Swf loaded from remote location:
--------------------------------------
OK http://site.com/dir/app.swf <http://site.com/dir/app.swf>  - Firefox 
OK http://site.com/dir/app.html <http://site.com/dir/app.html>  -
Firefox

FAIL http://www.site.com/dir/app.swf <http://www.site.com/dir/app.swf>
- Firefox
FAIL http://www.site.com/dir/app.html <http://www.site.com/dir/app.html>
- Firefox

FAIL http://site.com/dir/app.swf <http://site.com/dir/app.swf>  - IE
(Loads sample vid)
FAIL http://site.com/dir/app.html <http://site.com/dir/app.html>  - IE
(Loads sample vid)

FAIL http://www.site.com/dir/app.swf <http://www.site.com/dir/app.swf>
- IE (No sample vid)
FAIL http://www.site.com/dir/app.html <http://www.site.com/dir/app.html>
- IE (No sample vid)

Swf run Locally
--------------------------------------
OK app.swf - Running by itself on XP Desktop (locally, in Adobe's swf
player)
OK app.swf - Running in Firefox on XP Desktop (locally)
FAIL app.swf - Running in IE on Desktop (locally)

Code:
--------------------------------------
Inside 8.swf, an embedded Flash8 app in my Flex2 app.swf
AVM_lc = new LocalConnection();
AVM_lc.allowInsecureDomain('*');
AVM_lc.exchangeMovie = Delegate.create(this, changeMovie);
AVM_lc.connect("AVM2toAVM1");
...
function changeMovie(s:String):Void
{
a.loadMovie("http://site.com/get.php?t= <http://site.com/get.php?t=>
"+s);
play(true);
}

Inside app.swf, the Flex2 app
//Called every time a certain class of button is pressed
var AVM_lc:LocalConnection = new LocalConnection();
AVM_lc.allowInsecureDomain('*');
AVM_lc.send("AVM2toAVM1", "exchangeMovie", e.m); //e.m is "new movie
name"
//AVM_lc is not closed() but I assume it's garbage collected

crossdomain.xml (stored in root of site):

<cross-domain-policy>
<allow-access-from domain="*" secure="false"/>
</cross-domain-policy>



 

Reply via email to