6 Replies Latest reply on May 20, 2013 6:46 AM by kglad

    scroll-resizer problem

    teeronline Level 1

      Hello!

       

      I made this script for a resizer scroller, basically scaleTransform_mc  is a mc that, more it move close to its _x = 80, Square_mc will resize itself accordingly.

       

      this script is working at the moment, however if I rotate Square_mc 90 degrees, either cw or cc. it doesn't work. I wonder why, script is pretty basic

       

      scaleTransform_mc.onPress = function(){

          startDrag(this,0, 0, 100, 80, 100);            << scroll mc from _x = 0 to 80;

          //

          this.onMouseMove = function() {

              var ori_width= Square_mc._width;

              var ori_height = Square_mc._height;

              var height_ratio = ori_height/ori_width;           << lets say square is 4X4 the ratio would be 1

             

              var xmouse = this._x;

              var ymouse = this._y;

              var minWidth = xmouse+ 5;             << set min width for square is no less than 5 ( so ppl can still see even scroll all the way to left)

             

              //trace(xmouse);

              //trace(ymouse);

             

              Square_mc._width = minWidth*2.5;         << square width be same as scale_x  times 2.5

              Square_mc._height = height_ratio*Square_mc._width ;                << height is square_height times height_ratio

          }

      }

       

      scaleTransform_mc.onRelease = function() {

          stopDrag();

      }