Results 1 to 2 of 2
  1.    #1  
    Could anyone give me some sample code for the Mojo.drag API? All i need is a div that you can drag around the scene. If anyone have used this API in their apps could you help get me started?

    Thanks,
    Bryce14
  2. #2  
    Quote Originally Posted by Bryce14 View Post
    Could anyone give me some sample code for the Mojo.drag API? All i need is a div that you can drag around the scene. If anyone have used this API in their apps could you help get me started?

    Thanks,
    Bryce14
    If you mean you want to drag something on the screen, you can use:

    Code:
    Element.observe(this.trackingArea, Mojo.Event.dragStart, this.dragStartHandler);
    
    ScrollerAssistant.prototype.dragScreen = function(event) {
    	this.rememberX = Event.pointerX(event.down);
    	Element.observe(this.trackingArea, Mojo.Event.dragging, this.draggingHandler);
    	Element.observe(this.trackingArea, Mojo.Event.dragEnd, this.dragEndHandler);
    	Event.stop(event);
    }
    
    ScrollerAssistant.prototype.draggingScreen = function(event) {
    	var nowX = Event.pointerX(event.move);
        Event.stop(event);
    }
    
    ScrollerAssistant.prototype.dragEndScreen = function(event) {
    	Element.stopObserving(this.trackingArea, Mojo.Event.dragging, this.draggingHandler);
    	Element.stopObserving(this.trackingArea, Mojo.Event.dragEnd, this.dragEndHandler);
    	Event.stop(event);
    }
    Or are you talking about drag/dropping a line from a selectlist to re-order?
    mobigamedepot.com

Tags for this Thread

Posting Permissions