Packagecom.esri.aws.services
Interfacepublic interface IIPUtil

Retrieve the client's current public IP address. Requires IPUtilActivator in Framework.

View the examples.

See also

IPUtilActivator


Public Methods
 MethodDefined by
  
getMyIP(responder:IResponder):void
Returns the public IP address of the browser.
IIPUtil
Method detail
getMyIP()method
public function getMyIP(responder:IResponder):void

Returns the public IP address of the browser.

Parameters
responder:IResponder — the responder to call on result/fault.
Examples
Basic_IPUtil
<?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>