Copy link to clipboard
Copied
Dear friends,
Greetings! iam using the following code to find IP address using AS3. It works in desktop, but not showing output details in IOS device. Please advise me how can I make it work in in IOS device.
import flash.net.NetConnection;
import flash.net.NetworkInterface;
import flash.net.*;
var netInterfaces: Vector.< NetworkInterface > = NetworkInfo.networkInfo.findInterfaces();
if (netInterfaces && netInterfaces.length > 0) {
for each(var i: NetworkInterface in netInterfaces) {
if (i.active) {
var addresses: Vector.< InterfaceAddress > = i.addresses;
for each(var j: InterfaceAddress in addresses) {
trace("- Host : " + j.address);
txt.appendText(j.address+'\n');
}
}
}
}
Thanks in Advance,
Regards,
Syed Abdul Rahim
Copy link to clipboard
Copied
AS3 Networkinfo class works on desktop and Air TV. You'll need a native extension for IOS. Details here: NetworkInfo native extension sample | Adobe Developer Connection
Copy link to clipboard
Copied
i think as3 has all the classes you need:
function ipF():String{
var ni:Vector. = NetworkInfo.networkInfo.findInterfaces();
var addresses:Vector. = ni[1].addresses;
return addresses[0].address;
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now