/**class ini bersifat opensource tidak untuk diperjual belikan,
*walaupun demikian kami menghargai jika anda menghargai sumbernya
*------------Ricko Nada www.pustakaflash.com----------------------*
//Main.as
package
{
import flash.display.MovieClip;
import com.PustakaFlash.mouseku;
import flash.events.MouseEvent;
import flash.events.Event;
public class Main extends MovieClip
{
public var custumMouse;
public function Main():void
{
if (stage)
{
init();
}
else
{
addEventListener(Event.ADDED_TO_STAGE, init);
}
}
public function init(e:Event = null):void
{
custumMouse = new mouseku(stage,false);
mcn.addEventListener(MouseEvent.MOUSE_DOWN, tekan);
mcn.addEventListener(MouseEvent.MOUSE_UP, angkat);
}
public function tekan(event:MouseEvent):void
{
trace("Mouse clicked");
custumMouse.down();
}
public function angkat(event:MouseEvent):void
{
trace("angkat");
}
}
}
//timelineScript or primitive script
import com.PustakaFlash.mouseku;
var custumMouse:mouseku=new mouseku(stage,false);
mcn.addEventListener(MouseEvent.MOUSE_DOWN, tekan);
function tekan(event:MouseEvent):void
{
trace("Mouse clicked");
custumMouse.down();
}
mcn.addEventListener(MouseEvent.MOUSE_UP, angkat);
function angkat(event:MouseEvent):void
{
trace("angkat");
}
*/
package com.PustakaFlash
{
import flash.display.*;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.ui.Mouse;
import flash.filters.*;
/*
**####################################
** @author Ricko www.pustakaflash.com
**####################################
*/
public class mouseku extends MovieClip
{
private var c;
private var s:Stage;
private var d:Boolean;
private var b;
private var e;
private var sd;
public function mouseku(t:Stage,v= null)
{
// constructor code
c= new mouse();
sd = new DropShadowFilter()
d = v;
s = t;
tb();
h();
t.addChild(c);
c.mouseEnabled = false;
}
private function tb()
{
s.addEventListener(MouseEvent.MOUSE_DOWN, down);
s.addEventListener(MouseEvent.MOUSE_UP, up);
c.addEventListener(Event.ENTER_FRAME, cursor);
}
private function cursor(event:Event)
{
c.x = s.mouseX + 2;
c.y = s.mouseY;
sd.distance = 5;
sd.color = 0x000000;
sd.blurX = 5;
sd.blurY = 5;
sd.quality = 3;
c.filters = [sd];
}
private function h()
{
trace(d);
if (! d)
{
Mouse.hide();
d = false;
}
}
private function get show()
{
Mouse.show();
}
public function down(event:MouseEvent=null):void
{
c.gotoAndStop(3);
}
private function up(event:MouseEvent=null):void
{
//trace("up");
c.gotoAndStop(1);
}
}
}
WHAT'S NEW?
Loading...
Custum cursor
- Judul : Custum cursor
- Penulis : PF studio
- Kategori : Archive Code Snippets
-
Rating : 100% based on 10 ratings. 5 user reviews.
Item Reviewed: Custum cursor
9 out of 10 based on 10 ratings. 9 user reviews.
facebook
twitter
google+
fb share