1 Reply Latest reply on Apr 27, 2006 10:15 AM by Newsgroup_User

    Move and Resize

    jnewc
      I Have one lage (space) movie clip whith differant size pictures in defferant spots. How do I move and resize the mc so that it appears that I am zooming it on those differant images with I press a button.

      here is what I have used before to move a mc.

      stop();
      mSpeed = 15;
      MovieClip.prototype.mEaseMove = function() {
      this.onEnterFrame = function() {
      this._y += (dY-this._y)/mSpeed;
      this._x += (dX-this._x)/mSpeed;
      };
      };
      _root.bc1.onRelease = function() {
      _root.mcImg.mEaseMove();
      dY = 243;
      dX = -465.8;
      };
        • 1. Re: Move and Resize
          Level 7
          jnewc,

          > I Have one lage (space) movie clip whith differant size
          > pictures in defferant spots. How do I move and resize
          > the mc so that it appears that I am zooming it on those
          > differant images with I press a button.

          You adjust the MovieClip._xscale and MovieClip._yscale properties of the
          movie clip in question. This will increase/decrease the size of the ship,
          making it look closer and farther away.

          To do this at the press of a button, you'll have to use the
          Button.onRelease event of a button instance (or the MovieClip.onRelease
          event of a movie clip instance) -- or some other event, like onPress) and
          program the function assigned to this event to manipulate the
          above-mentioned properties.

          The sample code you showed uses prototype, which isn't really necessary,
          here. Ther'es nothing wrong with doing what you did, but it means that all
          movie clips will feature an mEaseMove() method -- and presumably, you only
          want your spaceship movie clip to have this method.


          David
          stiller (at) quip (dot) net
          Dev essays: http://www.quip.net/blog/
          "Luck is the residue of good design."


          >
          > here is what I have used before to move a mc.
          >
          > stop();
          > mSpeed = 15;
          > MovieClip.prototype.mEaseMove = function() {
          > this.onEnterFrame = function() {
          > this._y += (dY-this._y)/mSpeed;
          > this._x += (dX-this._x)/mSpeed;
          > };
          > };
          > _root.bc1.onRelease = function() {
          > _root.mcImg.mEaseMove();
          > dY = 243;
          > dX = -465.8;
          > };
          >