?? oldswitch.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 + -