PDA

View Full Version : [MX 2004] Problem with _global variables & crossDomain



anarcoma
April 6th, 2005, 02:03 AM
Is there or is there not possible to access _global variables between domains?

on www.Domain1.com i have index.html and index.swf. Index.swf then loads main.swf from www.Domain2.com.

In index.swf i have a _global variable that i want main to use. When calling for it all i get is undefined. The only way to access it is if i call for it using _parent or _root.

I have allowed the domains to communicate using
System.security.allowDomain("http://www.Domain1.com");
System.security.allowDomain("http://www.Domain2.com");

I have also put a crossdomain policy file on both servers..

But i dont really think this is a problem i can solve with cross domain policys since i CAN access the variables and functions using _parent and _root...or is it?

Photogenius
April 6th, 2005, 05:54 AM
are those meant to be hyperlinked?

anarcoma
April 6th, 2005, 08:21 AM
are those meant to be hyperlinked?


hehe.. no. sorry.

anarcoma
April 7th, 2005, 04:25 AM
so? Can _global variables be accessed between domains...yes? no? does anybody know?

virusescu
April 7th, 2005, 05:50 AM
Variables in flash are Client-Side. If the swf form domain2 gets loaded then you must have access to the variables too.
It must be a path problem.

Xeef
April 7th, 2005, 07:23 AM
try it whit -->


System.security.allowDomain("www.Domain1.com");

how ever as fare i know hass a F6 NO access to F7 if it comes from a diferent domain
there is NO fix for this (just in case)

anarcoma
April 8th, 2005, 05:00 AM
Variables in flash are Client-Side. If the swf form domain2 gets loaded then you must have access to the variables too.
It must be a path problem.

are you sure this applies to _global variables as well? I cant see that i would use the wrong path for a _global variable ....since its supposed to be accessed globally

virusescu
April 8th, 2005, 07:00 AM
When you asked me this way.. I kind of lost my confidence :D
What I mean by client side is that if we have a flash .. we both access.. and I at my computer set a _global variable, there's no way for you to read, even if you use the same client, if I don't send the variable to the server. If it reaches the server.. then ... yes.. it's server side.. and anybody could read it