Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////////////////////////////////////
- //
- // © 2017 nexters.com
- //
- ////////////////////////////////////////////////////////////////////////////////
- package ru.nexters.ie2.view.components.drag {
- import feathers.dragDrop.DragDropManager;
- import starling.core.Starling;
- /**
- * @author v.proskurin
- * @version 1.0
- * @playerversion Flash 10
- * @langversion 3.0
- * @date Mar 27, 2017
- */
- public class InstrumentData {
- public static const SETUP:String = 'InstrumentData.SETUP';
- public static const COLLECT:String = 'InstrumentData.COLLECT';
- public static var current:InstrumentData;
- public static function get isActive():Boolean {
- return current != null && DragDropManager.isDragging;
- }
- public var type:String;
- public var data:*;
- public var callback:Function;
- public var count:int = 0;
- public function InstrumentData(id:String) {
- this.type = id;
- this.data = DragDropManager.dragData.getDataForFormat(id);
- }
- public function dispatch(value:Boolean):void {
- if (value) count++;
- if (callback!=null) {
- callback(this, value);
- }
- }
- public function cancel():void {
- DragDropManager.cancelDrag();
- Starling.current.touchProcessor.currentTouches.length = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement