Save adr.jsp file in your root directory:
<%@ page contentType="text/html; charset=iso-8859-1" language="java"
errorPage="" %>
<Adr><%=request.getHeader("REMOTE_ADDR")%></Adr>
Here is example how to get client IP Address in Flex (you can use
binding or result function to store client IP address):
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" initialize="userIDSrv.send();"
>
<mx:Script>
<![CDATA[
public function readRslt():void{
var s:String =userIDSrv.lastResult.Adr;
}
]]>
</mx:Script>
<mx:Binding source="{userIDSrv.lastResult.Adr}"
destination="txt.text" />
<mx:HTTPService
id="userIDSrv"
url="adr.jsp" result="readRslt()" />
<mx:Label text="Client IP address: "/>
<mx:Text id="txt"/>
</mx:Application>
Enjoy,
Irina Vovkoriz
--- In [email protected], "Matt Horn" <[EMAIL PROTECTED]> wrote:
>
> I think the best way is to get the IP addy with whatever language
you use in the wrapper (JSP, ASP, PHP, etc) and then pass it to the
app as a flashvar variable.
>
> hth,
>
> matt horn
> flex docs
>
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Luís Gustavo
Sanabio
> > Sent: Thursday, July 06, 2006 2:01 PM
> > To: [email protected]
> > Subject: Re: [flexcoders] How to get client IP Address?
> >
> > I use a PHP request to do this.
> >
> >
> > 2006/7/6, Cleiton Luiz Coradelli <[EMAIL PROTECTED]>:
> >
> > There is any way to get the client IP Address in Flex?
> >
> > TIA
> >
> >
> >
> > .
> >
> >
> >
> >
> >
> >
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/