当水平或垂直滚动产生时会触发scroll事件,flash.events.Event类的SCROLL常量即代表该事件 package { import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFieldType; import flash.utils.getTimer; public class Sample0323 extends Sprite { private var textBox:TextField; private var textInfo:TextField; public function Sample0323() { textBox = new TextField(); textBox.type = TextFieldType.INPUT; textBox.width = 250; textBox.height = 100; textBox.border = true; textBox.borderColor = 0xFFFF00; textBox.background = true; textBox.backgroundColor = 0xFFFFFF; textBox.wordWrap = true; textBox.addEventListener(Event.SCROLL,onScroll); this.addChild(textBox); textInfo = new TextField(); textInfo.type = TextFieldType.INPUT; textInfo.y = 300; textInfo.autoSize = TextFieldAutoSize.CENTER; this.addChild(textInfo); } private function onScroll(event:Event):void { textInfo.text = flash.utils.getTimer()+" -- 滚动了"; } } }