2 Replies Latest reply on Jan 12, 2010 5:20 AM by Ned Murphy

    Zooming in/out on one MC of many.

    MonkeyFace999

      Still using MX!  I'd like to have my viewers mouse over any of the MovieClips on the scene and using the keyup / keydown have only that MC scale up or down.  The scaling should only effect the moused over MC.

       

      Here is what I'm using for the scaling on one MC now...

       

      var Listener:Object;
      Listener = new Object();
      Listener.onKeyDown = function()
      {
          if (Key.isDown(Key.UP))
          {       
                  container._xscale = container._xscale + 10;
                  container._yscale = container._yscale + 10;
          }
          if (Key.isDown(Key.DOWN))
          {       
                  container._xscale = container._xscale - 10;
                  container._yscale = container._yscale - 10;
          }
      };
      Key.addListener(Listener);

       

       

      Thank you in advance again...(Ned!!!?????)

      Marc

        • 1. Re: Zooming in/out on one MC of many.
          thil

          hi.. try this code..

          container.onRollOver  = function()
          {
              this.onEnterFrame = function()
              {
                container._xscale = container._xscale + 10;
                   container._yscale = container._yscale + 10;
              }
          }

          container.onRollOut  = function()
          {
              this.onEnterFrame = function()
              {
                     container._xscale = container._xscale - 10;
                     container._yscale = container._yscale - 10;
            
                     if(container._xscale == 100 and container._xscale ==100)
                     {
                       delete this.onEnterFrame
                     }
              }
          }

          • 2. Re: Zooming in/out on one MC of many.
            Ned Murphy Adobe Community Professional & MVP

            Based on what you described, you will only want the rollover code to assign a target to a variable.  For the code you show, that variable would be called "container".

             

            So the timeline code would be something like...

             

            var container:Object;

             

            movieName.onRollOver = function(){  // where movieName is the mc instance name

                 container = movieName;

            }

             

            movieName2.onRollOver = function(){  // where movieName2 is the next mc instance name

                 container = movieName2;

            }

             

            // followed by your key handling code