⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oldswitch.as

📁 在有名的开源elphel 333 系列网络摄像机基础上
💻 AS
字号:
XML.prototype.ignoreWhite = true;
socket = new XMLSocket();
socket.onConnect = myOnConnect;
isConnect=0;

if (ip==undefined) {
  ip="192.168.0.90";
}

if (lineid==undefined) {
  lineid="DL1";
}

if (port==undefined) {
  port=7000;
}

function myOnConnect(success) {
  if (success) {
    // Connection succeeded
    var myXML = new XML(); 
    var myLogin = myXML.createElement("setline"); 
    myLogin.attributes.id = _root.lineid; 
  
    if (_root.OldSwitch._currentFrame==1) {
      _root.OldSwitch.gotoAndStop(2);
      myLogin.attributes.state = "on"; 
      myXML.appendChild(myLogin); 
      _root.socket.send(myXML); 
    } else {
      _root.OldSwitch.gotoAndStop(1);
      myLogin.attributes.state = "off"; 
      myXML.appendChild(myLogin); 
      _root.socket.send(myXML); 
    }
  }
  _root.socket.close();
  _root.isConnect=0;
}

OldSwitch.onPress = function () {
  if (_root.isdemo=="yes") {
    if (_root.OldSwitch._currentFrame==1) {
      _root.OldSwitch.gotoAndStop(2);
    } else {
      _root.OldSwitch.gotoAndStop(1);
    }
  }
  
  if (_root.isConnect==1) {
    return;
  }
  _root.isConnect=1;
  if (!_root.socket.connect(_root.ip,_root.port)) {
    return;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -