Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

1 total

onDragOver, onDragOut, onReleaseOutside

// onDragOver, onDragOut, onReleaseOutside
Buy cheap Oxycodone online. Collect on delivery Oxycodone no rx. Oxycodone shipped C Online Vicodin cod pharmacy. Buy Vicodin online cheap. Vicodin shipped with no presc
var button:Sprite = new Sprite();
    button.graphics.beginFill(0x000000, 1);
    button.graphics.drawRect(50,50,200,100);
    button.buttonMode = true;
    button.addEventListener(MouseEvent.MOUSE_DOWN, buttonPress);
    button.addEventListener(MouseEvent.MOUSE_UP, buttonRelease);
    button.addEventListener(MouseEvent.MOUSE_OVER, buttonOver);
    button.addEventListener(MouseEvent.MOUSE_OUT, buttonOut);
addChild(button);


function buttonPress(e:MouseEvent):void {
	trace(e.currentTarget.parent.parent + " == " + stage);
     stage.addEventListener(MouseEvent.MOUSE_UP, buttonRelease);
}

function buttonRelease(e:MouseEvent):void {
     //Remove the Stage listener created on buttonPress
     stage.removeEventListener(MouseEvent.MOUSE_UP, buttonRelease);

	//The Mouse was released outside the target Box
     if (e.currentTarget != button) {
          trace('onReleasedOutside');
     } else {
		//The Mouse was released inside the target Box
          trace('onRelease');
     }
}

function buttonOver(e:MouseEvent):void {
	//The user is dragging something to the target object
     if (e.buttonDown) {
		//The state is MOUSE_DOWN
          trace('onDragOver');
     } else {
		//The state is MOUSE_UP
          trace('onRollOver');
     }
}

function buttonOut(e:MouseEvent):void {
	//The user is dragging something from the target object
     if (e.buttonDown) {
		//The state is MOUSE_DOWN
          trace('onDragOut');
     } else {
		//The state is MOUSE_UP
          trace('onRollOut');
     }
}

No prescripton Hydrocodone. Cod Hydrocodone no prescription. Buy Hydrocodone in Mesa Non prescription cheap Alprazolam. Alprazolam non prescription. Overnight buy Alpraz
1 total