• flash跟随鼠标样式


    package {
        import flash.display.Sprite;
        import flash.ui.Mouse;
        import flash.events.MouseEvent;
        import flash.events.Event;
        import flash.display.Shape;
        
    
        
        public class FollowMouse extends Sprite {
            
            private var _icon : Shape; //鼠标样式
            private var box : Sprite; //被点击的对像
            
            
            public function FollowMouse() {
                //鼠标样式不能为可接收事件对像,否则无法点击其它对像
                _icon = new Shape();
                _icon.graphics.beginFill(0xff0000);
                _icon.graphics.drawCircle(0, 0, 20);
                _icon.graphics.endFill();
                _icon.name = "mouse icon";
                
                this.stage.addChild(_icon);
                _icon.x = stage.stageWidth / 2 - _icon.width / 2;
                _icon.y = stage.stageHeight / 2 - _icon.height / 2;
                Mouse.hide();
                
                stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
                
                box = new Sprite();
                box.graphics.beginFill(0x000000);
                box.graphics.drawRect(0, 0, 100, 100);
                box.graphics.endFill();
                addChild(box);
                box.addEventListener(MouseEvent.CLICK, boxClick);
                //_icon.addEventListener(MouseEvent.CLICK, iconClick);
                
            }
            
            private function iconClick(e : MouseEvent) : void {
                trace(".....................");
            }
            
            private function boxClick(e : MouseEvent) : void {
                box.visible = false;
            }
            
            private function onMove(e : MouseEvent) : void {
                _icon.x = mouseX;
                _icon.y = mouseY;
            }
        }
    }
  • 相关阅读:
    c语言 循环、数组、指针、冒泡排序、最大最小(上课)
    路由器远程配置实验
    一个排序小程序(上课)
    shells/clickhouse.sh
    shells/insertToTable.sh
    shells/flink.sh
    shells/hadoop.sh
    shells/flume.sh
    shells/hadoop
    练习:Flink ProcessWindowFunction、AggregateFunction、KeyedProcessFunction
  • 原文地址:https://www.cnblogs.com/playerlife/p/2727430.html
Copyright © 2020-2023  润新知