# WDTM: scrolling text

**URL:** <https://forum.kirupa.com/t/wdtm-scrolling-text/282168>\
**Category:** flash\
**Created:** [February 18, 2009, 3:16pm UTC](https://forum.kirupa.com/t/wdtm-scrolling-text/282168 "2009-02-18T15:16:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smallDot](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@smallDot](https://forum.kirupa.com/u/smallDot)\
**Post date:** [February 18, 2009, 3:16pm UTC](https://forum.kirupa.com/t/wdtm-scrolling-text/282168/1 "2009-02-18T15:16:33Z")

</div>

i tried to comment the code 🙂

```auto

// the "scrollRect" is a property in the DisplayObject class,
//while "Rectangle" is a method in the Rectangle class, how the programmer
//knows that he needs this method to combine these togather.
bigText.scrollRect = new Rectangle(0, 0, bigText.width, 350);

bigText.cacheAsBitmap = true;
function scrollUp(event:MouseEvent):void {
    //What i understood here is: we created the "rect" with the properties
    //of the bigText.
    var rect:Rectangle = bigText.scrollRect;
    rect.y -= 20;
    
    //i do not get it at all, we created the "rect" with the "bigText" properties
    //now, we reverse it?, os that right?
    //Tell me why
    bigText.scrollRect = rect;
}
function scrollDown(event:MouseEvent):void {
    var rect:Rectangle = bigText.scrollRect;
    rect.y += 20;
    bigText.scrollRect = rect;
}
up.addEventListener(MouseEvent.CLICK, scrollUp);
down.addEventListener(MouseEvent.CLICK, scrollDown);

```

Thanks
