Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage.addEventListener(MouseEvent.CLICK,onClick,false,0,true);
- function onClick(evt:MouseEvent):void
- {
- var ring:MovieClip=new Ring();
- ring.x=mouseX;
- ring.y=mouseY;
- addChildAt(ring,0);
- stage.removeEventListener(MouseEvent.CLICK,onClick);
- ring.addEventListener(MouseEvent.MOUSE_DOWN, onStartDrag);
- ring.addEventListener(MouseEvent.MOUSE_UP, onStopDrag);
- }
- function onStartDrag(evt:MouseEvent):void{
- evt.target.startDrag();
- }
- function onStopDrag(evt:MouseEvent):void{
- stopDrag();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement