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 / May 2004



Tip: Looking for answers? Try searching our database.

localhost should be replaced

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vidal - 20 May 2004 20:29 GMT
Flash Remoting is supposed to automatically replace localhost with the host of
whatever server calls the application.  This is according to the following note
in the topic on NetServices.setDefaultGatewayURL in the Flash Remoting docs.

Note: If you specify localhost as the host in the setDefaultGatewayURL method,
and you run your Flash application from outside the Flash development
environment or stand-alone Flash player, Flash Remoting MX does not use
localhost as the default gateway host. Instead, it replaces localhost and any
port specified in the setDefaultGatewayURL method with the host and port
specified to run the Flash application. For example, if you specify
http://localhost/flashservices/gateway in the setDefaultGatewayURL method and
start your Flash application by using the URL
http://apps.mycompany.com:8500/flashapps/myapp.swf in a web page or browser,
Flash Remoting MX uses http://apps.mycompany.com:8500/flashservices/gateway as
the default gateway URL.

However, using the following code in my Flash Client, this does not work.

#include "NetServices.as"
if (inited == null) {
inited = true;
NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway/");
servConnection = NetServices.createGatewayConnection();
servObject = servConnection.getService("service", this);
}

According to the note above I should not have to change localhost to my
webserver's hostname when I deploy to a webserver, or for that matter when I
call the page from my local computer using my host name instead of localhost.  
But, this does not work.  It only works on localhost and I have to change
localhost to my hostname if I want to call the application using my hostname
instead of localhost.

I have reported this as a bug to Macromedia.  However, if anyone sees a
problem with my code or a way to fix this, please let me know.

Thanks.
Giovanni Manghi - 24 May 2004 02:58 GMT
>  I have reported this as a bug to Macromedia.  However, if anyone sees a
> problem with my code or a way to fix this, please let me know.
>
>  Thanks.

Get some answers about this problem?
pstnotpd - 24 May 2004 07:48 GMT
Hi,
As far as I understand it this refers to the fact that the URL resolves
to the url stated in the OBJECT/EMBED tag used to call the flash movie
in your page. So if you generate the calling HTML with the movie you can
replace the URL value there and is will resolve to the correct server
regardless of what you enter in setDefaultGatewayURL.

As far as I know it does not work when you call the swf directly, i.e.
it doesn't resolve from the URL you type in.

We've got this working here, testing on localhost and deploying to
production using a OBJECT/EMBED in our CMS system.

> Flash Remoting is supposed to automatically replace localhost with the host of
> whatever server calls the application.  This is according to the following note
[quoted text clipped - 33 lines]
>
>  Thanks.
Vidal - 24 May 2004 15:43 GMT
We ended up using the same solution - adding the server to the OBJECT/EMBED
tag.  However, the note mentions nothing about the OBJECT/EMBED tag -
therefore, you should not have to do this, or the note needs to be elaborated
on to explain this.  Lucian Beebe of Macromedia returned my bug report with the
following message:

"Thank you for your message. I'm sorry about the problem you are experiencing.
I have forwarded it to our Tech Support team to look at. Clearly there may be
an issue here, but is it causing you a specific problem, or just a point of
confusion?"

I returned his email requesting that either the documentation or the bug be
corrected and let him know that we set a Paramater in the OBJECT/EMBED tag to
fix the issue, however according to the note, it should not require this.

Thanks.
 
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.