0 Replies Latest reply on May 25, 2006 8:51 AM by Newsgroup_User

    [flash mx 2004] strange behavior

    Level 7
      Hi,

      I have a strange behavior I don't understand in a script:

      I have :
      - "test" mc on stage
      - code below in 1st frame
      - behavior is normal for top/left and bottom/right areas but not for
      top/right and bottom/left areas

      Any idea about this behavior ?

      seb


      _root.test.onPress = function (){
      this.x0 = _root._xmouse;
      this.y0 = _root._ymouse;
      _root.test._x = this.x0;
      _root.test._y = this.y0;
      _root.test.onEnterFrame = function () {
      var x1 = _root._xmouse - this.x0;
      var y1 = _root._ymouse - this.y0;
      var rotation = 0;
      var tmp = 0;
      if(x1 < 0 && y1 < 0) {
      x1 = -x1;
      y1 = -y1;
      rotation = 180;
      } else if(x1 < 0 && y1 > 0) {
      tmp = y1;
      y1 = -x1;
      x1 = tmp;
      rotation = 90;
      } else if(x1 > 0 && y1 < 0) {
      tmp = y1;
      y1 = x1;
      x1 = -tmp;
      rotation = -90;
      }
      _root.test._width = x1;
      _root.test._height = y1;
      _root.test._rotation = rotation;
      }
      }
      _root.test.onRelease = _root.test.onReleaseOutside = function () {
      delete _root.test.onEnterFrame;
      }
      stop();