2016-10-13 00:16:48 点击量:42 标签: 收藏本文
[AS3]as3.0滚动事件响应,当水平或垂直滚动产生时会触发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()+" -- CuPlayer.com提示滚动了";
- }
- }
- }
我们是一家提供综合软件外包与弱电工程服务的技术公司。
业务涵盖定制软件、管理系统、网站、小程序、APP、系统集成、网络布线、监控安防、门禁、机房建设及长期技术维护。
公司地址:湖北省宜昌市伍家岗区东站二路6号三峡(宜昌)大数据产业园海洋馆二楼A203室