# Automatic vertical text scroller

**URL:** <https://forum.kirupa.com/t/automatic-vertical-text-scroller/312668>\
**Category:** flash\
**Created:** [August 10, 2010, 8:15am UTC](https://forum.kirupa.com/t/automatic-vertical-text-scroller/312668 "2010-08-10T08:15:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![developer\_new](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@developer\_new](https://forum.kirupa.com/u/developer_new)\
**Post date:** [August 10, 2010, 8:15am UTC](https://forum.kirupa.com/t/automatic-vertical-text-scroller/312668/1 "2010-08-10T08:15:22Z")

</div>

I’m new to flash and got stuck trying to design an automatic vertical text scroller.

Here is what I set out to do:

- Have a news ticker like box through which text will be vertically scrolling.
- The textual content will come from an external text file.
- The text in the external file will also have click-able html links.
- When the mouse enters the content area, the scrolling would stop.
- If any link is visible in the content area at that time, the user will be able to click on it.
- When the mouse leaves the content area, the scrolling would continue.

Basically, it’s an html marquee which you see in so many pages these days.

The following was my approach to solving the problem. Got very close and then got stuck ☹

- I created a Dynamic Textbox and have it load from the external file. The dynamic textbox has multiline and autoSize set to true. So the size of it grows depending on the content from the external file.
- Next, converted the “textbox with external loading” into a movie clip and named it content\_mc.
- Created a rounded rectangle (my viewing area) and converted that to a movie clip called mask\_mc.
- On the stage, the content\_mc is in one layer (content) and the mask\_mc is in another layer (mask).
- Added another layer (action) and on the first frame of the main timeline, I entered the Action Script to set the mask\_mc as the mask for content\_mc.
- Also in this AS, I align the content\_mc top with the mask\_mc top so that the content is visible at the start.
- Then in the content layer, I inserted a movie clip “controller”. This clip has two frames and all it does is it moves the \_root.content\_mc up by a fixed unit until the bottom of content\_mc is over the mask\_mc top. At that point, it sets the top of the content\_mc back to the top of mask\_mc.

Since I have little to no flash training, you can understand my excitement when the above steps worked and I got a fairly smooth scrolling text fitted in my viwing window. I could also click on all the links in my text. Yayyy!

Then I took on the task of making the scroll stop and resume on mouse enter and leave event. What I did was:

- In the action script on the action layer, I simply defined two content\_mc.onRollOver and content\_mc.onRollOut functions. In the first I stop the controller movie clip and in the second, I play the controller movie clip.

The above strategy also worked as I wanted but it created a new problem! Whenever the mouse enters the mask area, the mouse pointer turns into a clicking hand cursor (the one you use to click on links); and it doesn’t allow me to click on any of the html links anymore! It’s almost as if the content\_mc movie clip has turned into a button!

Regardless to say, this is unacceptable in my case if I cannot click on the html links in the original text content. I have googled quite a bit and must admit that I haven’t had much luck (why else would I be posting here and other places?). I desperately need someone’s assistance with solving this. Some of the approaches I have seen on google wouldn’t work for me. For example, having invisible buttons for the html links. Of course that wouldn’t work since my text is coming from an external text file over which I have no control.

Any guidance in the right direction will be much appreciated. And of course, I have almost no time left to solve this. But since what I am trying to achieve is something so simple, I’m assuming the solution would not take prohibitively long.

Thanks in advance to all the nice and helpful people who will be pouring in with their suggestions.
