AS3代码创建FLASH文本编辑器
作者 佚名技术
来源 服务器技术
浏览
发布时间 2012-07-07
():void { my_btn_font.x = 230; my_btn_font.y = 22; for (var i:uint = 0; i < my_Arr_font.length; i++) { //trace(my_Arr_font.fontName) my_btn_font.addItem({label:my_Arr_font.fontName}); } my_btn_font.textField.setStyle("textFormat", linkTextFormat); my_btn_font.dropdown.setRendererStyle("textFormat", linkTextFormat); my_btn_font.width = 115; my_btn_font.addEventListener(Event.CHANGE,_setTextFormatNext); } //显示居左按钮 private function _showBtn_left():void { my_btn_left.x = 355; my_btn_left.y = 25; my_btn_left.addEventListener(MouseEvent.ROLL_OVER, changeNext); my_btn_left.addEventListener(MouseEvent.ROLL_OUT, changeCurrent); my_btn_left.addEventListener(MouseEvent.CLICK, _setTextFormat); } //显示居中按钮 private function _showBtn_middle():void { my_btn_middle.x = 380; my_btn_middle.y = 25; my_btn_middle.addEventListener(MouseEvent.ROLL_OVER, changeNext); my_btn_middle.addEventListener(MouseEvent.ROLL_OUT, changeCurrent); my_btn_middle.addEventListener(MouseEvent.CLICK, _setTextFormat); } //显示居右按钮 private function _showBtn_right():void { my_btn_right.x = 405; my_btn_right.y = 25; my_btn_right.addEventListener(MouseEvent.ROLL_OVER, changeNext); my_btn_right.addEventListener(MouseEvent.ROLL_OUT, changeCurrent); my_btn_right.addEventListener(MouseEvent.CLICK, _setTextFormat); } //显示下划线按钮 private function _showBtn_xiahuaxian():void { my_btn_xiahuaxian.x = 430; my_btn_xiahuaxian.y = 25; my_btn_xiahuaxian.addEventListener(MouseEvent.ROLL_OVER, changeNext); my_btn_xiahuaxian.addEventListener(MouseEvent.ROLL_OUT, changeCurrent); my_btn_xiahuaxian.addEventListener(MouseEvent.CLICK, _setTextFormat); } //显示超链接按钮 private function _showBtn_url():void { my_btn_url.x = 455; my_btn_url.y = 25; my_btn_url.addEventListener(MouseEvent.ROLL_OVER, changeNext); my_btn_url.addEventListener(MouseEvent.ROLL_OUT, changeCurrent); my_btn_url.addEventListener(MouseEvent.CLICK, _setTextFormat); } //显示插入图片按钮 private function _showBtn_pic():void { my_btn_pic.x = 170; my_btn_pic.y = 25; my_btn_pic.addEventListener(MouseEvent.ROLL_OVER, changeNext); my_btn_pic.addEventListener(MouseEvent.ROLL_OUT, changeCurrent); my_btn_pic.addEventListener(MouseEvent.CLICK, _setTextFormat); } //设置样式(A) private function _setTextFormat(e:MouseEvent):void { switch (e.currentTarget) { case my_btn_bold : _TextFormat_bold(); break; case my_btn_itlic : _TextFormat_italic(); break; case my_btn_left : _TextFormat_auto_left(); break; case my_btn_middle : _TextFormat_auto_middle(); break; case my_btn_right : _TextFormat_auto_right(); break; case my_btn_xiahuaxian : _TextFormat_xiahuaxian(); break; case my_btn_url : my_btn_url_shuru.x = 200; my_btn_url_shuru.y = 130; my_btn_url_shuru.ok.addEventListener(MouseEvent.CLICK, _TextFormat_url); my_btn_url_shuru.cancel.addEventListener(MouseEvent.CLICK, _TextFormat_Clearurl); my_btn_url_shuru.addEventListener(MouseEvent.MOUSE_DOWN, startDrags); my_btn_url_shuru.addEventListener(MouseEvent.MOUSE_UP, stopDrags); my_Sprite.ad |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于AS3代码创建FLASH文本编辑器的所有评论