ActionScript: code for finding mac address doesn't work

微笑、不失礼 提交于 2019-12-25 02:34:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!