| Package | com.esri.aws.services |
| Interface | public interface IIPUtil |
See also
| Method | Defined by | ||
|---|---|---|---|
|
getMyIP(responder:IResponder):void
Returns the public IP address of the browser.
| IIPUtil | ||
| getMyIP | () | method |
public function getMyIP(responder:IResponder):voidReturns the public IP address of the browser.
Parametersresponder:IResponder — the responder to call on result/fault.
|
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:awx="http://www.arcwebservices.com/2007/awx"
implements="mx.rpc.IResponder"
creationComplete="onComplete()"
>
<mx:Script>
<![CDATA[
import com.esri.aws.osgi.framework.ServiceTracker;
import com.esri.aws.osgi.framework.IServiceReference;
import flash.utils.getQualifiedClassName;
import com.esri.aws.services.IIPUtil;
import mx.controls.Alert;
private var ipTracker:ServiceTracker;
private function onComplete():void
{
ipTracker = new ServiceTracker(framework.systemContext, getQualifiedClassName(IIPUtil));
ipTracker.open();
}
public function getMyIP():void
{
var ipService:IIPUtil = ipTracker.getService() as IIPUtil;
if (ipService)
{
ipService.getMyIP(this);
}
}
public function result(data:Object):void
{
info.text = "Your Public IP Address is: " + data as String;
}
public function fault(info:Object):void
{
Alert.show(info.toString());
}
]]>
</mx:Script>
<awx:Framework id="framework" apiKey="[MY-API-KEY]" frameworkStart="getMyIP()">
<awx:IPUtilActivator/>
</awx:Framework>
<mx:Text id="info" fontSize="14" top="80"/>
</mx:Application>