GetUrl Flash Actionscript

Can actionscript execute a different URL depending on what server its

Page 1 of 1

1 Replies - 3284 Views - Last Post: 06 February 2009 - 06:54 AM

#1 Mauzer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 06-February 09

GetUrl Flash Actionscript

Posted 06 February 2009 - 06:47 AM

I want to be able to run a geturl command depeneding on what server the script is being run from. For instance the script below is being run from my development server but when I deploy the scripts live it wont work becuase its obviously looking at "localhost". Is there a way in Actionscript to check the IP address or server it is on before executing the geturl function?

on (release) {
getURL("http://localhost/holidayhomes/index.cfm?method=location.filter&countryid=72","_self");

}


something like this.....

if server is localhost


on (release) {
getURL("http://localhost/holidayhomes/index.cfm?method=location.filter&countryid=72","_self");

}

else



on (release) {
getURL("http://www.holidayhomes.co.uk/index.cfm?method=location.filter&countryid=72","_self");

}

Hope someone can help! Thnaks

Is This A Good Question/Topic? 0
  • +

Replies To: GetUrl Flash Actionscript

#2 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: GetUrl Flash Actionscript

Posted 06 February 2009 - 06:54 AM

Is you swf in the same folder as index.cfm? If so, then you're fine to drop all the path stuff anyway, making your code:

on (release) {
	 getURL("index.cfm?method=location.filter&countryid=72","_self");
}



Otherwise, you're probably going to have to use javascript to strip the url for the bit you want and pass it to flash as a flashVar.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1