15.10.2012 Views

Actionscript 3 Entwicklerhandbuch

Actionscript 3 Entwicklerhandbuch

Actionscript 3 Entwicklerhandbuch

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ACTIONSCRIPT 3.0 ENTWICKLERHANDBUCH<br />

Grundlagen zu Netzwerken und Kommunikation<br />

package {<br />

import flash.display.Sprite;<br />

import flash.net.InterfaceAddress;<br />

import flash.net.NetworkInfo;<br />

import flash.net.NetworkInterface;<br />

public class NetworkInformationExample extends Sprite<br />

{<br />

public function NetworkInformationExample()<br />

{<br />

var networkInfo:NetworkInfo = NetworkInfo.networkInfo;<br />

var interfaces:Vector. = networkInfo.findInterfaces();<br />

}<br />

}<br />

}<br />

if( interfaces != null )<br />

{<br />

trace( "Interface count: " + interfaces.length );<br />

for each ( var interfaceObj:NetworkInterface in interfaces )<br />

{<br />

trace( "\nname: " + interfaceObj.name );<br />

trace( "display name: " + interfaceObj.displayName );<br />

trace( "mtu: " + interfaceObj.mtu );<br />

trace( "active?: " + interfaceObj.active );<br />

trace( "parent interface: " + interfaceObj.parent );<br />

trace( "hardware address: " + interfaceObj.hardwareAddress );<br />

if( interfaceObj.subInterfaces != null )<br />

{<br />

trace( "# subinterfaces: " + interfaceObj.subInterfaces.length );<br />

}<br />

trace("# addresses: " + interfaceObj.addresses.length );<br />

for each ( var address:InterfaceAddress in interfaceObj.addresses )<br />

{<br />

trace( " type: " + address.ipVersion );<br />

trace( " address: " + address.address );<br />

trace( " broadcast: " + address.broadcast );<br />

trace( " prefix length: " + address.prefixLength );<br />

}<br />

}<br />

}<br />

Weitere Informationen finden Sie unter:<br />

NetworkInfo<br />

NetworkInterface<br />

InterfaceAddress<br />

Flexpert: Detecting the network connection type with Flex 4.5<br />

Letzte Aktualisierung 27.6.2012<br />

839

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!