3 Replies Latest reply on May 23, 2006 6:47 PM by Dz(00)

    Tween class problem

    Dz(00)
      Hi - I'm using this script to animate some movieclips:

      import mx.transitions.Tween;
      import mx.transitions.easing.*;
      kText.onRollOver = function() {
      var btnScale:Tween = new Tween(kText.people, "_width", Elastic.easeOut, 30, 300, 30, false);
      var btnScale:Tween = new Tween(kText.people, "_height", Elastic.easeOut, 30, 200, 30, false);
      };

      Which is fine, but when I target an mc within an mc such as:

      kText.inner_mc.onRollOver = function() {
      var btnScale:Tween = new Tween(kText.inner_mc, "_width", Elastic.easeOut, 30, 300, 30, false);
      var btnScale:Tween = new Tween(kText.inner_mc, "_height", Elastic.easeOut, 30, 200, 30, false);
      };

      is doesn't seem to work - anyone know where I'm going wrong

      cheers
        • 1. Re: Tween class problem
          tonyhigham
          your tweening script is ok, so maybe your RollOver events are conflicting. from what you've got here, it looks like you want are scaling kText, which will also scale its children (including inner_mc), and then scaling inner_mc again when it's rolled over? try tracing something in your inner_mc.RollOver function and see if the even is firing properly. if i've misunderstood your setup, please feel free to set me straight.
          • 2. Re: Tween class problem
            Peter Lorent Level 2
            kText.inner_mc.onRollOver = function() {
            var btnScale:Tween = new Tween(this, "_width", Elastic.easeOut, 30, 300, 30, false);
            • 3. Re: Tween class problem
              Dz(00) Level 1
              Hi - thanks for your help. this is the script I'm using:

              kText.onPress = function() {
              var xScale:Tween = new Tween(this, "_width", Back.easeOut, current_width, 2497, 30, false);
              var xScale:Tween = new Tween(this, "_height", Back.easeOut, current_height, 559, 30, false);
              var xPos:Tween = new Tween(this, "_x", Back.easeOut, current_x, 1300, 40, false);
              var yPos:Tween = new Tween(this, "_y", Back.easeOut, current_y, -100, 40, false);
              var btn_alpha:Tween = new Tween(this.people, "_alpha", Strong.easeOut, 100, 0, 40, false);
              xScale.onMotionFinished = function() {
              _root.attachMovie("123", "att123", 1);
              att123._x = 300;
              att123._y = 300;
              };
              };
              kText.people.onRollOver = function() {
              var btnScale:Tween = new Tween(this, "_width", Elastic.easeOut, 30, 300, 30, false);
              };


              but the second function won't work as long as the first function is there - if I take out the first function the second one works fine.

              cheers.