问题
I have the following code in Actions of a keyframe in Adobe Flash Professional CS6:
var networkInterface : Object = NetworkInfo.networkInfo.findInterfaces();
var networkInfo : Object = networkInterface[0];
var physicalAddress : String = networkInfo.hardwareAddress.toString();
When I hit Ctrl+Enter to run the movie, I get the following compiler error:
Scene 1, Layer 'Layer 1', Frame 2, Line 1 1120: Access of undefined property NetworkInfo.
What do I do wrong?
回答1:
you must add:
import flash.net.NetworkInfo;
and in publish settings you must chose Adobe AIR rather than flash player
来源:https://stackoverflow.com/questions/22376537/actionscript-code-for-finding-mac-address-doesnt-work