5 Replies Latest reply on Jan 20, 2009 1:08 PM by Rothrock

    custom scroller with bitmap text

      Hi, I've tried searching but keep on getting the same strange error. My scripting know-how is extremely limited so please bare with me.

      I've created a custom text scroller and the scrolling text is bitmap text. The problem i'm having is that I need to have the scroller scroll in full pixel increments because the text ends up blurring if the clip doesn't end up on a whole number. Essentially what I need is: if text scrolls 0-0.5, text scrolls 0. if text scrolls 0.5-0.99, text scrolls 1 (I need it to round off to a whole pixel.).

      Here's my script:

      var scrollUpper:Number = 0;
      var scrollLower:Number = 532;

      var textLower:Number = 0;
      var textUpper:Number = -256;

      var scrollRange:Number = scrollLower - scrollUpper;
      var textRange:Number = textLower - textUpper;

      function scroll() {
      var moved:Number = scroller_mc._y - scrollUpper;
      var pctMoved:Number = moved/scrollRange;
      var textMove:Number = pctMoved*textRange;
      textClip._y = textLower - textMove;

      scroller_mc.onPress = function() {
      this.onMouseMove = scroll;

      scroller_mc.onRelease = scroller_mc.onReleaseOutside = function() {
      this.onMouseMove = null;

      Any help would be much appreciated. This is driving me insane.