0 Replies Latest reply on Jun 15, 2008 8:51 PM by IceX89

    Help with migrating issue AS3 to AS2

      Hi all , im havin problem migrating my 90% done codes in AS3.0 to AS2.0 because of the lack of webservices support for AS3.0 . can someone help mi with the following conversion of codes ?


      Red2_mc.addEventListener("mouseDown", pieceMove);
      Red3_mc.addEventListener("mouseDown", pieceMove);

      Red2_mc.addEventListener("mouseUp", pieceMove);
      Red3_mc.addEventListener("mouseUp", pieceMove);

      function pieceMove(evt : Event):void {
      if (evt.type == "mouseDown") {
      evt.target.startDrag();
      evt.target.parent.addChild(evt.target);
      startX = evt.target.x;
      startY = evt.target.y;



      for (var q :Number = 0; q<beingDragged.length; q++) {
      if (Math.abs(startX - beingDragged
      quote:

      .x) == 52 && Math.abs(startY - beingDragged
      quote:

      .y)==0 || (Math.abs(startX - beingDragged
      quote:

      .x) == 26 && Math.abs(startY - beingDragged
      quote:

      .y )== 39)) {
      canJump = 1;

      }
      }

      } else if (evt.type == "mouseUp") {
      evt.target.stopDrag();




      and :

      var gameStartTime:uint;
      var gameTime:uint;
      var gameTimeField:TextField;
      gameTimeField = new TextField();
      gameTimeField.x = 1;
      gameTimeField.y = 1;
      gameTimeField.scaleX = 1.5;
      gameTimeField.scaleY = 1.5;
      addChild(gameTimeField);


      gameStartTime = getTimer();
      gameTime = 0;

      addEventListener(Event.ENTER_FRAME,showTime);

      function showTime(event:Event) {
      gameTime = getTimer()-gameStartTime;
      gameTimeField.text = "Time lapsed: "+clockTime(gameTime);

      }


      function clockTime(ms:int) {
      var seconds:int = Math.floor(ms/1000);
      var minutes:int = Math.floor(seconds/60);
      seconds -= minutes*60;
      var timeString:String = minutes+":"+String(seconds+100).substr(1,2);
      return timeString;
      }


      thanks in advance ...