Toggle navigation
Sign Up
Log In
Explore
Works
Folders
Tools
Collections
Artists
Groups
Groups
Topics
Tasks
Tasks
Jobs
Teams
Jobs
Recommendation
More Effects...
ActionScript
// forked from dkgkAs's マウスカーソルをボタンの動作(ハンドカーソル)にする /** * マウスカーソルをボタンの動作(ハンドカーソル)にする * http://d.hatena.ne.jp/ActionScript/20080927/as3_mouse_cursor_button * * 赤ボタンはハンドカーソルになる _button1.buttonMode = true; */ package { import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; [SWF(width = 465, height = 465, backgroundColor = 0x94e4e8, frameRate = 30)] public class MouseCursor1 extends Sprite { private var _scx:Number; private var _scy:Number; private var _button1:Sprite; private var _button2:Sprite; public function MouseCursor1():void { _scx = stage.stageWidth * 0.5; _scy = stage.stageHeight * 0.5; setup(); this._button1.addEventListener(MouseEvent.CLICK, clickHandler); // 赤ボタン this._button2.addEventListener(MouseEvent.CLICK, clickHandler); // 青ボタン } private function clickHandler(event:MouseEvent):void { event.target.rotation += 15; } private function setup():void { _button1 = createButton(0xcc0000); _button1.x = _scx; _button1.y = _scy - _button1.height * 2; _button1.buttonMode = true; // ココ! 指のマークになる! this.stage.addChild(_button1); _button2 = createButton(0x0000cc); _button2.x = _scx; _button2.y = _scy + _button2.height * 2; this.stage.addChild(_button2); } private function createButton(color:uint):Sprite { var button:Sprite = new Sprite(); button.graphics.beginFill(color); button.graphics.drawRoundRect( -100, -25, 200, 50, 30); button.graphics.endFill(); return button; } } }
Join Effecthub.com
Working with Global Gaming Artists and Developers!
Login
Sign Up
Or Login with Your Email Address:
Email
Password
Remember
Or Sign Up with Your Email Address:
Your Email
This field must contain a valid email
Set Password
Password should be at least 1 character
Stay informed via email