How to find ip address in as3?

I am trying to find ip addres using as3 in adobe Flash professional cs5. I do not know how to do that. Is it possible to find the IP address using as3?

+4
source share
2 answers

No, this is not possible for AS3 without using any server technology. You can use the bootloader and download something like http://whatismyip.org/ to get an IP address. But without any server (i.e. from a clean flash) this is not possible.

+4
source

Setting up Air 2.5 The end result in CS5 is a way to get an IP address.

import flash.net.InterfaceAddress; import flash.net.NetworkInfo; import flash.net.NetworkInterface; function findIPAddress():void { var networkInfo = NetworkInfo.networkInfo; var interfaces = networkInfo.findInterfaces(); var interfaceObj; var address; //Get available interfaces for (var i = 0; i < interfaces.length; i++) { interfaceObj = interfaces[i]; for (var j = 0; j < interfaceObj.addresses.length; j++) { address = interfaceObj.addresses[j]; trace(address.address + "\n"); } } } findIPAddress(); 
+4
source

Source: https://habr.com/ru/post/1388921/


All Articles