ProblemYou want to have some actions performed when a text field's contents are scrolled. SolutionListen for the scroll event. DiscussionWhen a text field is scrolled vertically or horizontally (meaning that the scrollV or scrollH property has been changed either by your custom ActionScript code or a scrollbar), the text field dispatches a scroll event. The scroll event name is defined by the SCROLL constant of the flash.events.Event class, and the event that is dispatched is a flash.events.Event object. The following code registers a listener for the scroll event for a text field called field: field.addEventListener(Event.SCROLL, onTextScroll); The following defines an example onTextScroll( ) method that listens for the scroll event: private function onTextScroll(event:Event):void { trace("scroll"); } See AlsoRecipes 9.23 and 9.24 |