So we now know that this code will scroll the text up if the up variable is true. But how does the up variable come to be true? We set it so with a button, that's how! And for this example I've made my button set it to true when it is moused over. Also, on mouse off the up variable is set back to false because otherwise the field would keep scrolling! So here's what the code looks like:

on (rollOver) {
 _root.up = true;
}
on (press, release, releaseOutside, rollOut, dragOut) {
 _root.up = false;
}

You'll notice I've included a long list of possible events to set the up variable back to false, that's just to be entirely sure it is set back on mouse out. If you want the button to perform some other action on release for example, you can remove the release handler from the above code and add your other actions under a new on (release) handler.

Finally, note that the HTML example also loads the text variable from a text file and uses HTML formatting on the dynamic text field. You have to check the HTML box in this example or the HTML won't work properly, but you knew that I'm sure.

That's really about it. I don't think any more explanation is needed and my dinner smells inviting so I'm going to go eat it! If you think of anything that needs to be added to the tutorial, email me. If you have questions or need further info post on the forums, don't email me questions please, I get enough email as is.

Jesse Stratford is the Co-Master of ActionScript.org and a freelance Flash developer and teacher. He is based in Australia and enjoys all things Flash.

NB: If you have comments or feedback please feel free to email me, but please do not email me Flash questions; the forums are provided for that purpose and you will get a faster answer by posting you question there.

If you have found this tutorial helpful, I hope that you will take 30 seconds to visit The Hunger Site where, with just one click you can make a free donation of food to a starving person in a third-world country. We do not benefit financially from this action; it is purely an act of charity.
This tutorial is protected by International Intellectual Property Rights laws and may not be reproduced or redistributed in full or part, without the prior written consent of the author. Unauthorized reproduction of this tutorial or its contents may result in prosecution. I've worked hard on this tutorial, please don't steal it.