Dynamic gateway URL/end-point URL with Flex Builder

View: New views
9 Messages — Rating Filter:   Alert me  

Dynamic gateway URL/end-point URL with Flex Builder

by Alex Cook-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think I've already asked this a few months ago, but does anyone know how to dynamically change the gateway URL in Flex 3 at runtime?

In Flash you can pass the gateway URL... so you can have your app connect to a different URL based on certain scenarios.  But in Flex, you define the gateway URL before you compile, so it gets stored in the swf file.

Anyone know of a way to dynamically declare the end-point URL at run-time?

Alex

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general

Re: Dynamic gateway URL/end-point URL with Flex Builder

by Ashier de Leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://blog.ashier.com/2008/03/06/wrapper-class-for-a-remoteobject/
It creates a wrapper for the RemoteObject class and allows you not to use compiler options. I don't know if its the best practice though.

I hope this will help you...

Ashier

On Tue, Jul 8, 2008 at 2:53 PM, Alex Cook <cook@...> wrote:
I think I've already asked this a few months ago, but does anyone know how to dynamically change the gateway URL in Flex 3 at runtime?

In Flash you can pass the gateway URL... so you can have your app connect to a different URL based on certain scenarios.  But in Flex, you define the gateway URL before you compile, so it gets stored in the swf file.

Anyone know of a way to dynamically declare the end-point URL at run-time?

Alex

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general




--
DE LEON, Ashier R.
Flash / Flex / AIR Development
Mobile Phone: +63.917.764.1593
Blog : http://blog.ashier.com
Personal Sites:http:ashier.com; http://nixth.com
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general

Re: Dynamic gateway URL/end-point URL with Flex Builder

by Alex Cook-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is great.  What about if I want to use straight RemoteObject, and I want my calls to look like this:

myservice.MyMethod.send (var, var2, var3);

That's the syntax I'm using now for Flex, so I don't really want to go back and change it to the format in your example:

myService.send("MyMethod")

Anyways, haven't really tried your example yet but do you get what I'm saying?

Alex

On Tue, Jul 8, 2008 at 3:50 AM, Ashier de Leon <ashier@...> wrote:
http://blog.ashier.com/2008/03/06/wrapper-class-for-a-remoteobject/
It creates a wrapper for the RemoteObject class and allows you not to use compiler options. I don't know if its the best practice though.

I hope this will help you...

Ashier

On Tue, Jul 8, 2008 at 2:53 PM, Alex Cook <cook@...> wrote:
I think I've already asked this a few months ago, but does anyone know how to dynamically change the gateway URL in Flex 3 at runtime?

In Flash you can pass the gateway URL... so you can have your app connect to a different URL based on certain scenarios.  But in Flex, you define the gateway URL before you compile, so it gets stored in the swf file.

Anyone know of a way to dynamically declare the end-point URL at run-time?

Alex

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general




--
DE LEON, Ashier R.
Flash / Flex / AIR Development
Mobile Phone: +63.917.764.1593
Blog : http://blog.ashier.com
Personal Sites:http:ashier.com; http://nixth.com

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general

Re: Dynamic gateway URL/end-point URL with Flex Builder

by Romuald Quantin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I had the same problem; I don’t know how to do that.

 

I know WebOrb allows you to do that, but I’d like to know how to do it with amfphp as well.

 

Romu

 


From: amfphp-general-bounces@... [mailto:amfphp-general-bounces@...] On Behalf Of Alex Cook
Sent: 08 July 2008 15:14
To: amfphp-general@...
Subject: Re: [amfphp] Dynamic gateway URL/end-point URL with Flex Builder

 

This is great.  What about if I want to use straight RemoteObject, and I want my calls to look like this:

myservice.MyMethod.send (var, var2, var3);

That's the syntax I'm using now for Flex, so I don't really want to go back and change it to the format in your example:

myService.send("MyMethod")

Anyways, haven't really tried your example yet but do you get what I'm saying?

Alex

On Tue, Jul 8, 2008 at 3:50 AM, Ashier de Leon <ashier@...> wrote:

http://blog.ashier.com/2008/03/06/wrapper-class-for-a-remoteobject/
It creates a wrapper for the RemoteObject class and allows you not to use compiler options. I don't know if its the best practice though.

I hope this will help you...

Ashier

On Tue, Jul 8, 2008 at 2:53 PM, Alex Cook <cook@...> wrote:

I think I've already asked this a few months ago, but does anyone know how to dynamically change the gateway URL in Flex 3 at runtime?

In Flash you can pass the gateway URL... so you can have your app connect to a different URL based on certain scenarios.  But in Flex, you define the gateway URL before you compile, so it gets stored in the swf file.

Anyone know of a way to dynamically declare the end-point URL at run-time?

Alex

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general




--
DE LEON, Ashier R.
Flash / Flex / AIR Development
Mobile Phone: +63.917.764.1593
Blog : http://blog.ashier.com
Personal Sites:http:ashier.com; http://nixth.com

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general

Re: Dynamic gateway URL/end-point URL with Flex Builder

by Alex Cook-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We could just write the code generation in the service browser and create the methods inside your class.  Just an initial thought, don't have time right now to look into it though.

On a side note, I think you can sort of set a dynamic gateway URL like this:

    <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

as opposed to:


    <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://www.mydomain.com/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

This makes it so you can move your app onto any domain, as opposed to hard coding the domain.  It's useful but it's still not exactly what I'm looking to do because I need one domain to go over http:// and one to go over https://...

If anyone out there has a solution let us know?

--Alex

On Tue, Jul 8, 2008 at 10:18 AM, Romuald Quantin <romuald@...> wrote:

I had the same problem; I don't know how to do that.

 

I know WebOrb allows you to do that, but I'd like to know how to do it with amfphp as well.

 

Romu

 


From: amfphp-general-bounces@... [mailto:amfphp-general-bounces@...] On Behalf Of Alex Cook
Sent: 08 July 2008 15:14
To: amfphp-general@...
Subject: Re: [amfphp] Dynamic gateway URL/end-point URL with Flex Builder

 

This is great.  What about if I want to use straight RemoteObject, and I want my calls to look like this:

myservice.MyMethod.send (var, var2, var3);

That's the syntax I'm using now for Flex, so I don't really want to go back and change it to the format in your example:

myService.send("MyMethod")

Anyways, haven't really tried your example yet but do you get what I'm saying?

Alex

On Tue, Jul 8, 2008 at 3:50 AM, Ashier de Leon <ashier@...> wrote:

http://blog.ashier.com/2008/03/06/wrapper-class-for-a-remoteobject/
It creates a wrapper for the RemoteObject class and allows you not to use compiler options. I don't know if its the best practice though.

I hope this will help you...

Ashier

On Tue, Jul 8, 2008 at 2:53 PM, Alex Cook <cook@...> wrote:

I think I've already asked this a few months ago, but does anyone know how to dynamically change the gateway URL in Flex 3 at runtime?

In Flash you can pass the gateway URL... so you can have your app connect to a different URL based on certain scenarios.  But in Flex, you define the gateway URL before you compile, so it gets stored in the swf file.

Anyone know of a way to dynamically declare the end-point URL at run-time?

Alex

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general




--
DE LEON, Ashier R.
Flash / Flex / AIR Development
Mobile Phone: +63.917.764.1593
Blog : http://blog.ashier.com
Personal Sites:http:ashier.com; http://nixth.com

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general

Re: Dynamic gateway URL/end-point URL with Flex Builder

by Ashier de Leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

@alex, I believe that would be possible also.. You may use:

myRemoteObject.getRemoteObject("myMethod").send(params)
or
myRemoteObject.myMethod(params)



On Tue, Jul 8, 2008 at 10:18 PM, Romuald Quantin <romuald@...> wrote:

I had the same problem; I don't know how to do that.

 

I know WebOrb allows you to do that, but I'd like to know how to do it with amfphp as well.

 

Romu

 


From: amfphp-general-bounces@... [mailto:amfphp-general-bounces@...] On Behalf Of Alex Cook
Sent: 08 July 2008 15:14
To: amfphp-general@...
Subject: Re: [amfphp] Dynamic gateway URL/end-point URL with Flex Builder

 

This is great.  What about if I want to use straight RemoteObject, and I want my calls to look like this:

myservice.MyMethod.send (var, var2, var3);

That's the syntax I'm using now for Flex, so I don't really want to go back and change it to the format in your example:

myService.send("MyMethod")

Anyways, haven't really tried your example yet but do you get what I'm saying?

Alex

On Tue, Jul 8, 2008 at 3:50 AM, Ashier de Leon <ashier@...> wrote:

http://blog.ashier.com/2008/03/06/wrapper-class-for-a-remoteobject/
It creates a wrapper for the RemoteObject class and allows you not to use compiler options. I don't know if its the best practice though.

I hope this will help you...

Ashier

On Tue, Jul 8, 2008 at 2:53 PM, Alex Cook <cook@...> wrote:

I think I've already asked this a few months ago, but does anyone know how to dynamically change the gateway URL in Flex 3 at runtime?

In Flash you can pass the gateway URL... so you can have your app connect to a different URL based on certain scenarios.  But in Flex, you define the gateway URL before you compile, so it gets stored in the swf file.

Anyone know of a way to dynamically declare the end-point URL at run-time?

Alex

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general




--
DE LEON, Ashier R.
Flash / Flex / AIR Development
Mobile Phone: +63.917.764.1593
Blog : http://blog.ashier.com
Personal Sites:http:ashier.com; http://nixth.com

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general




--
DE LEON, Ashier R.
Flash / Flex / AIR Development
Mobile Phone: +63.917.764.1593
Blog : http://blog.ashier.com
Personal Sites:http:ashier.com; http://nixth.com
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general

Re: Dynamic gateway URL/end-point URL with Flex Builder

by Ashier de Leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think that would also work... haven't tested it though... tell us if it works perfectly...

Ashier

On Tue, Jul 8, 2008 at 10:24 PM, Alex Cook <cook@...> wrote:
We could just write the code generation in the service browser and create the methods inside your class.  Just an initial thought, don't have time right now to look into it though.

On a side note, I think you can sort of set a dynamic gateway URL like this:

    <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

as opposed to:


    <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://www.mydomain.com/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

This makes it so you can move your app onto any domain, as opposed to hard coding the domain.  It's useful but it's still not exactly what I'm looking to do because I need one domain to go over http:// and one to go over https://...

If anyone out there has a solution let us know?

--Alex


On Tue, Jul 8, 2008 at 10:18 AM, Romuald Quantin <romuald@...> wrote:

I had the same problem; I don't know how to do that.

 

I know WebOrb allows you to do that, but I'd like to know how to do it with amfphp as well.

 

Romu

 


From: amfphp-general-bounces@... [mailto:amfphp-general-bounces@...] On Behalf Of Alex Cook
Sent: 08 July 2008 15:14
To: amfphp-general@...
Subject: Re: [amfphp] Dynamic gateway URL/end-point URL with Flex Builder

 

This is great.  What about if I want to use straight RemoteObject, and I want my calls to look like this:

myservice.MyMethod.send (var, var2, var3);

That's the syntax I'm using now for Flex, so I don't really want to go back and change it to the format in your example:

myService.send("MyMethod")

Anyways, haven't really tried your example yet but do you get what I'm saying?

Alex

On Tue, Jul 8, 2008 at 3:50 AM, Ashier de Leon <ashier@...> wrote:

http://blog.ashier.com/2008/03/06/wrapper-class-for-a-remoteobject/
It creates a wrapper for the RemoteObject class and allows you not to use compiler options. I don't know if its the best practice though.

I hope this will help you...

Ashier

On Tue, Jul 8, 2008 at 2:53 PM, Alex Cook <cook@...> wrote:

I think I've already asked this a few months ago, but does anyone know how to dynamically change the gateway URL in Flex 3 at runtime?

In Flash you can pass the gateway URL... so you can have your app connect to a different URL based on certain scenarios.  But in Flex, you define the gateway URL before you compile, so it gets stored in the swf file.

Anyone know of a way to dynamically declare the end-point URL at run-time?

Alex

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general




--
DE LEON, Ashier R.
Flash / Flex / AIR Development
Mobile Phone: +63.917.764.1593
Blog : http://blog.ashier.com
Personal Sites:http:ashier.com; http://nixth.com

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general




--
DE LEON, Ashier R.
Flash / Flex / AIR Development
Mobile Phone: +63.917.764.1593
Blog : http://blog.ashier.com
Personal Sites:http:ashier.com; http://nixth.com
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general

Re: Dynamic gateway URL/end-point URL with Flex Builder

by Alex Cook-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

@ashier
Thanks for the hints.  When I started this app I used http://www.sephiroth.it/tutorials/flashPHP/flex_remoteobject/ to connect amfphp and Flex.  I like your way as well since you don't need to set compiler options.  Also like how it's in a class.   I'll go that route for the next app...

But, I just found a way to change the endpoint at runtime... it's actually pretty simple I should have figured it out earlier:

<mx:RemoteObject id="session" fault="handleRemotingError(event)" showBusyCursor="true" source="myamf.session" destination="amfphp" concurrency="single">
        <mx:method name="Test" result="handleTest(event)" />      
</mx:RemoteObject>

Then somewhere in your app:

session.endpoint           = Application.application.parameters.PostedGateway; // where PostedGateway is a parameter sent by swfobject.

--Alex

On Tue, Jul 8, 2008 at 10:27 AM, Ashier de Leon <ashier@...> wrote:
I think that would also work... haven't tested it though... tell us if it works perfectly...

Ashier


On Tue, Jul 8, 2008 at 10:24 PM, Alex Cook <cook@...> wrote:
We could just write the code generation in the service browser and create the methods inside your class.  Just an initial thought, don't have time right now to look into it though.

On a side note, I think you can sort of set a dynamic gateway URL like this:

    <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

as opposed to:


    <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://www.mydomain.com/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

This makes it so you can move your app onto any domain, as opposed to hard coding the domain.  It's useful but it's still not exactly what I'm looking to do because I need one domain to go over http:// and one to go over https://...

If anyone out there has a solution let us know?

--Alex


On Tue, Jul 8, 2008 at 10:18 AM, Romuald Quantin <romuald@...> wrote:

I had the same problem; I don't know how to do that.

 

I know WebOrb allows you to do that, but I'd like to know how to do it with amfphp as well.

 

Romu

 


From: amfphp-general-bounces@... [mailto:amfphp-general-bounces@...] On Behalf Of Alex Cook
Sent: 08 July 2008 15:14
To: amfphp-general@...
Subject: Re: [amfphp] Dynamic gateway URL/end-point URL with Flex Builder

 

This is great.  What about if I want to use straight RemoteObject, and I want my calls to look like this:

myservice.MyMethod.send (var, var2, var3);

That's the syntax I'm using now for Flex, so I don't really want to go back and change it to the format in your example:

myService.send("MyMethod")

Anyways, haven't really tried your example yet but do you get what I'm saying?

Alex

On Tue, Jul 8, 2008 at 3:50 AM, Ashier de Leon <ashier@...> wrote:

http://blog.ashier.com/2008/03/06/wrapper-class-for-a-remoteobject/
It creates a wrapper for the RemoteObject class and allows you not to use compiler options. I don't know if its the best practice though.

I hope this will help you...

Ashier

On Tue, Jul 8, 2008 at 2:53 PM, Alex Cook <cook@...> wrote:

I think I've already asked this a few months ago, but does anyone know how to dynamically change the gateway URL in Flex 3 at runtime?

In Flash you can pass the gateway URL... so you can have your app connect to a different URL based on certain scenarios.  But in Flex, you define the gateway URL before you compile, so it gets stored in the swf file.

Anyone know of a way to dynamically declare the end-point URL at run-time?

Alex

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general




--
DE LEON, Ashier R.
Flash / Flex / AIR Development
Mobile Phone: +63.917.764.1593
Blog : http://blog.ashier.com
Personal Sites:http:ashier.com; http://nixth.com

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general




--
DE LEON, Ashier R.
Flash / Flex / AIR Development
Mobile Phone: +63.917.764.1593
Blog : http://blog.ashier.com
Personal Sites:http:ashier.com; http://nixth.com

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general

Re: Dynamic gateway URL/end-point URL with Flex Builder

by Ashier de Leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

cool.... glad you've got it working.

On Tue, Jul 8, 2008 at 10:34 PM, Alex Cook <cook@...> wrote:
@ashier
Thanks for the hints.  When I started this app I used http://www.sephiroth.it/tutorials/flashPHP/flex_remoteobject/ to connect amfphp and Flex.  I like your way as well since you don't need to set compiler options.  Also like how it's in a class.   I'll go that route for the next app...

But, I just found a way to change the endpoint at runtime... it's actually pretty simple I should have figured it out earlier:

<mx:RemoteObject id="session" fault="handleRemotingError(event)" showBusyCursor="true" source="myamf.session" destination="amfphp" concurrency="single">
        <mx:method name="Test" result="handleTest(event)" />      
</mx:RemoteObject>

Then somewhere in your app:

session.endpoint           = Application.application.parameters.PostedGateway; // where PostedGateway is a parameter sent by swfobject.

--Alex


On Tue, Jul 8, 2008 at 10:27 AM, Ashier de Leon <ashier@...> wrote:
I think that would also work... haven't tested it though... tell us if it works perfectly...

Ashier


On Tue, Jul 8, 2008 at 10:24 PM, Alex Cook <cook@...> wrote:
We could just write the code generation in the service browser and create the methods inside your class.  Just an initial thought, don't have time right now to look into it though.

On a side note, I think you can sort of set a dynamic gateway URL like this:

    <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

as opposed to:


    <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://www.mydomain.com/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

This makes it so you can move your app onto any domain, as opposed to hard coding the domain.  It's useful but it's still not exactly what I'm looking to do because I need one domain to go over http:// and one to go over https://...

If anyone out there has a solution let us know?

--Alex


On Tue, Jul 8, 2008 at 10:18 AM, Romuald Quantin <romuald@...> wrote:

I had the same problem; I don't know how to do that.

 

I know WebOrb allows you to do that, but I'd like to know how to do it with amfphp as well.

 

Romu

 


From: amfphp-general-bounces@... [mailto:amfphp-general-bounces@...] On Behalf Of Alex Cook
Sent: 08 July 2008 15:14
To: amfphp-general@...
Subject: Re: [amfphp] Dynamic gateway URL/end-point URL with Flex Builder

 

This is great.  What about if I want to use straight RemoteObject, and I want my calls to look like this:

myservice.MyMethod.send (var, var2, var3);

That's the syntax I'm using now for Flex, so I don't really want to go back and change it to the format in your example:

myService.send("MyMethod")

Anyways, haven't really tried your example yet but do you get what I'm saying?

Alex

On Tue, Jul 8, 2008 at 3:50 AM, Ashier de Leon <