Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / April 2006



Tip: Looking for answers? Try searching our database.

Flash Remoting not working from browser

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Koop - 16 Apr 2006 20:45 GMT
Quick Problem:

I have a movie that connects and displays the data fine when run by testing
the movie from within flash its fine however as soon as i try to run it from
the html or by IIS link to the swf, or even by browsing to the swf via file
manager it fails to connect.

Any ideas why?

Thanks,
Koop.

Full Description:

My code was connecting fine before or at least i think it was.
Does anyone have a basic fla that works for them using the methods below
that i could test on my machine?

the connection code is as follows:

code =============
import mx.remoting.*;

function Result()
{
//receives data returned from the method
this.onResult = function(result)
{
 trace("Data received from server : " + result + result.items.length + "
items were received" );
//this is where we put the data in the text field
 for (i=0;i<results.items.length;i++){

  dataField.text = dataField.text + result.items.length;
 }
 dataField.text = dataField.text + result.items.length;
}

this.onStatus = function(error)
{
 trace("Error : " + error.description);
 dataField.text = "Error : " + error.description;
}
}

NetServices.setDefaultGatewayUrl("<mygatewayurl>");
var gw = NetServices.createGatewayConnection();
var server = gw.getService("flashservices.gateway.interaction", new
Result());
server.getLatestNews();

end code ================

A few things have flagged in my mind, they may be way off track however;
- Recent security changes in browsers (click here to activate...)
- My wildcard import on the first line however i'm not sure which
dependancies i specifically need to compile this project.
- cross domain security restrictions.. i am currently connecting to a
service at a remote server from my local machine/IIS

what confuses me is that good ol' CTRL+ENTER works fine but obviously fails
on any parameter calls such as loading "newsitem.swf?theID=<variableID>"
which requires that it be run via a webserver.

Any help would be appreciated.
Koop.
Joe - 19 Apr 2006 12:08 GMT
I had a similar prob and found it was caused by recent security changes
to the flash player.

I was using "127.0.0.1" as the address to my gateway but it was being
ignored because it didnt match as being the same host which was being
evaluated as "localhost". So I found that changing the gateway address
to "localhost" fixed it!

Solution: on your server (local or remote), put a file "crossdomain.xml"
in the webserver's root and fiddle with its contents so it contains all
the possible varieties of the domains you want to allow access from.

e.g.

<?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="http://www.yourdomain.co.uk" />
  <allow-access-from domain="www.yourdomain.co.uk" />
  <allow-access-from domain="yourdomain.co.uk" />
</cross-domain-policy>

That (I think) will solve your problem.

Joe

> Quick Problem:
>
[quoted text clipped - 62 lines]
> Any help would be appreciated.
> Koop.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.