flash scrolling text quesiton

Out of context: Reply #7

  • Started
  • Last post
  • 13 Responses
  • Visia0

    personally, I don't do it that way. What I usually do is build out a scroll pane from scratch. I find it easier/faster than using the component scrollpane. Plus, you get complete control over everything.

    So, basically make a clip called scrollPane.

    Drop another clip into that clip at 0,0.

    Call the nested clip "kontent" since Flash loves to usurp the name "content".

    Then drop a mask overtop of it and call it "kontentMask".

    Set the mask.

    Then make another clip that will be your scrollbar and call it scrollBar.

    Set the scrollBar clip up with some drag action. Lock it to it's own x and then stop it from going beyond the height of your pane on the Y.

    Then add an OnClipEvent(enterFrame) to the scrollBar clip.

    In the clipEvent set it like so:

    reverseY = this._y * -1;
    mag = (_parent.kontent._height - _parent.kontentMask._height ) /_parent._kontentMask._height;
    _parent.kontent._y = Math.floor(reverseY * mag);

    What this does is automatically detect the height of the kontent clip and then scrolls it in the opposite direction of the scrollBar clip with a maganification factor according to it's height vs. the height of it's mask.

    That way you can do away with the bullshit maxScroll property and drop anything you want into the clip. Text, Images, Animation, Video, etc.

    Hope that helps.

View thread