0 Replies Latest reply on Nov 13, 2006 12:39 AM by wangjkkl

    about SyncEvent

    wangjkkl
      my code:
      NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;
      SharedObject.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;
      nc = new NetConnection();
      nc.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
      nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, netSecurityError);
      nc.connect("rtmp:/test");
      function netStatus(event:NetStatusEvent):void {
      trace("netStatus: " + event);
      var info:Object = event.info;
      trace(info.code);
      if (info.code == "NetConnection.Connect.Success") {
      initRSO(nc);
      }
      }
      function initRSO(NC:NetConnection):void{
      my_rso = SharedObject.getRemote("mySo", NC.uri, true);
      if(my_rso){
      my_rso.addEventListener(SyncEvent.SYNC, syncfunc);
      my_rso.connect(NC);
      }
      function syncfunc(event:SyncEvent):void {
      mc.x=event.target.data.x;
      mc.y=event.target.data.y;
      trace(mc.x,mc.y);
      };
      stage.addEventListener(MouseEvent.MOUSE_DOWN,funonMouseDown)
      function funonMouseDown(event:MouseEvent):void {
      my_rso.data.x = root.mouseX;
      my_rso.data.y = root.mouseY;
      trace(my_rso.data.x,my_rso.data.y)
      trace(mc.x,mc.y);
      };
      }
      function netSecurityError(event:SecurityErrorEvent):void {
      trace("netSecurityError: " + event);
      }

      MouseEvent.MOUSE_DOWN...
      why mc.x and mc.y without change?