Skip navigation
Currently Being Moderated

How to programmatically set the endpoint in a flashbuilder created app

Apr 2, 2013 2:18 PM


I am running flashbuilder 4.5 for php premium.  I have created an application that read/writes to a postgresql database.

All is well.


Now for the unfun.   When I created the service in flashbuilder, I gave it a UNC for the gateway.php file.  Unfortuneately,

I don't know how to change the endpoint programmatically at run time.


My first thought was to use FlashVars in the html wrapper, then in my app in the Application creationComplete event handling code, I put

the following code:


var hostObj:Object = LoaderInfo(this.root.loaderInfo).parameters.myHost;

myService.endpoint = "http://" + hostObj.toString() + "/gateway.php";


that very much didn't work, and kinda screwed up my project.  Had to undo the html wrapper edit,  and the contentCreation code to get things

back in shape.


So, what is the correct way to programmatically set the endpoint?


Please note that the host file and dns will not solve my problem as many servers on a single network may be running my app.




More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points