0 Replies Latest reply on Nov 12, 2009 11:34 AM by Techmaniac

    UIScrollBar component tweaks out tween

    Techmaniac Level 1

      Hello


      I'm dynamically adding a scrollbar to a dynamic text field:

       

              createClassObject(mx.controls.UIScrollBar,"prodIntro_scroller", this.getNextHighestDepth());
              prodIntro_scroller.setScrollTarget(prodIntro_text);
              prodIntro_scroller.move(prodIntro_text._x + (prodIntro_text._width - 5),prodIntro_text._y,true);
              prodIntro_scroller.setSize(4, prodIntro_text._height);


      then making it invisible after the user mouses off the icon that varies the text:

       

           prodIntro_scroller.visible = false;

       

      The issue is, a tween created prior to the addition of the scrollbar is no longer working properly.  The tween is a combination resize and fade:

       

      var scale = 800;
      var speed = 61790;

       

      function fadeFrame(mc:MovieClip) {
          mc._alpha -= 5;
          if (mc._alpha<=0) {
              mc.alpha = 0;
              gotoAndStop(3);
          }
      }
      var faded = setInterval(this, "trans", 1500);
      function trans() {
          clearInterval(faded);
          _root.gotoAndStop(3);
      }

       

      The tween goes twice as fast, so really isn't visible from start to finish, and the only thing I can do to eliminate the change is to remove the THIS from the getNextHighestDepth variable when creating the scrollbar.  When you remove the THIS, it no longer removes the scrollbar after the click method (but the tween works normally.) 

       

      I'm stuck!