Find the IP address using as3 and server side technology

1.2k views Asked by At

I am trying to find the IP address using as3 in adobe Flash professional cs5.5 and I think it is not possible from AS3 without using any server side technology(maybe I am wrong). But I don't know any server side technology like PHP..etc.

Can anyone provide an example?

2

There are 2 answers

0
IneedHelp On

There's a simple and clean way to dynamically get the domain name, but not the IP, of the server hosting the SWF file.

You can use the domain property of the LocalConnection class.

try:

import flash.net.LocalConnection;
var lc:LocalConnection = new LocalConnection();
trace(lc.domain); // Outputs domain name of the hosting server, or `localhost` if ran locally.
0
Mrugesh On

you can get the Local Machine using JavaScript. and also you can develop server side script which will retirve your local machine IP address from request header.

But as per your comments on your question I think you required your local machine IP. it will be get using javascript. But this IP address is not gateway or server side displayed one. Because in home or some fire wall / proxy user has different IP to access internet and local mahcine ip will be LAN IP.

and Javascript code you can call using the External Interface.

Please search for Javascript and ExternInterface code example you will find out many code example through google.