Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flash player 9 crossdomain not working

Status
Not open for further replies.

javochan

Technical User
Feb 26, 2007
4
ES
Hello, I am new to this forum, and work in some flash/php/html applications

right now I am doing a dynamic list of data, wich means that I am doing several loadvars to different domains, reading their html, looking for the values I want and present them.

The problem is that, for some reason, since flash player 9 is installed, the flash doesn't work in the browsers (neither ie, neither firefox), at best it gives me a warning for trying to access another domain

I have seen this kind of problem before, on flash menus with external linking. But this was solved with a little program you could download from adobe (troublesome as it is, it worked).

However, now that there are no symbols on the stage, and the actionscript is more complex, the code works while testing the movie alone, but not in browsers.

I have tried:

1.adding to the actionscript
System.security.allowInsecureDomain("*");
System.security.allowDomain("*");

2.adding to the html the allowScriptAccess=always and allowNetworking=all, I added it everywhere, even to the AC_RunActiveContent parameters, knowing it is not implemented within the javascript

3.running the program adobe provides (LocalContentUpdater), wich works on menus, but not in the more complex projects I am in.

4.swearin on adobe/macromedia (didn't work either)


As a matter of fact, I don't wan't the web user to need to specifically allow this flash (solution suggested by adobe. My users are not computer experts, if prompted about anything, a few will know understand what to do. most will not)

If anyone knows how to solve this, I will be deeply grateful

Thank you

the function that fails to work is the next:

Code:
function expee(maindata) {
	var valuefirst:LoadVars = new LoadVars();
	valuefirst.load("[URL unfurl="true"]http://firstdomain.com/scripts/valuefirst.php?varobjective="+maindata);[/URL]
	valuefirst.onLoad = function(successc) {
		var supradata:LoadVars = new LoadVars();
		supradata.load("[URL unfurl="true"]http://seconddomain.org/secondary.php?valuethat="+valuefirst.valuefirst+"&varobjective:"+maindata);[/URL]
		supradata.onLoad = function(success) {
			var suprastring = supradata.toString();
			//function to get the variable finalvalue from suprastring, too long to put here
			var my_lv:LoadVars = new LoadVars();
			my_lv.load("targetphp.php?error=0&expee="+finalvalue+"&varobjective="+maindata);
			rankfinal.htmlText = finalvalue;
			trace("ranking = "+finalvalue);
		};
	};
}

I have flash 8 pro, and have installed flash player 9,0,28,0 internet explorer 6.0.29, and firefox 15.0.9

When in browser, it loads firstdomain (mostly), but not seconddomain
 
Well, still working on this

I have found, on the adobe site, that flash can't? access an external domain (while in browser), and the solution it gives is to run a server-side script. However the main point of doing this in flash is to do it client-side.
It also says I could upload a "Shim SWF" on the seconddomain, however, I don't have access to that domain. (besides, how I am going to load that swf if it doesn't let me read it?)
I also found something about policy files, but my problem remains, I can't write a thing on seconddomain (neither want to)

I don't understand this, does all this means that I can't do a dynamic form to and from multiple domains, and I can't use flash to get info from around the web? and even if I could, can't I distribute it? I intend to do several multiple domain tools in flash, but this is cracking me down. (just think about, for example, a game distributed freely, wich reads an html the site owners decides, and present that on the credits section)

AAAAARRRGHHHH!!! I need help
 
You can still place a PHP (or whatever), which collects data from other domains, in your own server. Your SWF can talk to this PHP as they are in the same domain.

This cross domain access restriction does not just applies to Flash but also applies to web browsers too. It's a standard security feature.

Kenneth Kawamoto
 
Thank you for the reply

However, I intend the flash to be requested very frequently, so I intend the flash to do as much work as possible, and to distribute it so I don't have to bother where it is located. (less traffic for my server). sever-side technology is my last option (like php)

I have a friend learning Java, and investigating the issue, to do it client-sided, but java have to be specifically enabled, (and I don't trust java very much)

Any other workaround?

Thank you
 
You can distribute your Flash movie as standalone Projector, which should not have access restrictions imposed.

If you're distributing as a web based movie, you have to use server script unless you have an access to the 3rd party server - if you have the access then you can place a cross domain policy file there (or place "shim" SWF).

If you can use Java applet instead of Flash then Java applet can access cross domain data - according to a colleague of mine.

Kenneth Kawamoto
 
Yes, I had arrived to the same conclussion

I am going to do this current project as a standalone projector (already tested, crossdomain works).

Total client-side application.

and a php version, with less features (to focus on the .exe), to web pages

Thank you very much for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top