精易论坛

标题: FLASH 中as3接收,发送包关键字能转成易语言命令吗 [打印本页]

作者: yuan6805053    时间: 2018-9-19 07:54
标题: FLASH 中as3接收,发送包关键字能转成易语言命令吗
public function sendCommand(param1:ByteArray) : void
      {
         try
         {
            this.writeBytes(param1);   这一句转成易命令.
         }
         catch(error:IOError)
         {
         }
         flush();
      }
发送包



      public function onData(param1:ProgressEvent) : void
      {
         var _loc2_:ByteArray = new ByteArray();  这个中括号三句转成易命令.
         readBytes(_loc2_);
         dispatchEvent(new SocketEvent(SocketEvent.DATA,_loc2_));
      }
接收包.

上面两个关键字怎么转成易命令...

谢谢热心懂的.



作者: yuan6805053    时间: 2018-9-19 08:07
public class SocketEvent extends Event
   {
      
      public function SocketEvent(param1:String, ... rest)
      {
         super(param1);
         if(param1 == DATA)
         {
            this._bytes = rest[0] as ByteArray;
         }
         else if(param1 == CONNECT)
         {
            if(rest.length > 0)
            {
               this._success = rest[0] as Boolean;
            }
         }
         
      }
      
      public static const DATA:String = "dataReceived";
      
      public static const CONNECT:String = "connect";
      
      public static const CLOSE:String = "close";
      
      public static const FAILED:String = "failed";

这个是这个类的声明
作者: 晴雯晴雯    时间: 2018-9-19 08:36
websocket wss的话用模块,其他的不会
作者: c32x78    时间: 2018-10-8 11:36
大多是字节(序列化后)的操作 这个要懂a33的数据结构



补充内容 (2018-10-8 11:36):
as




欢迎光临 精易论坛 (https://125.confly.eu.org/) Powered by Discuz! X3.4