Drag And Drop problem

By }{ermanssoN | Jan 7, 2009

actionscript3

Hi.

I’m quite new to actionscrip 3.0.
I have a sprite wich I can be draged and drop. But, I also want to be able to just click on it. But when i Drag and Drop it, Click is called when I release the mouse button.

I would like to find a way to avoid calling click when I drop my sprite. Click should only be called when I actualy click on it.

I hope I’m not the only one who have experienced the same problem.

//}{ermanssoN

Code:


m_Sprite.addEventListener( MouseEvent.MOUSE_DOWN, StartDrag);
m_Sprite.addEventListener( MouseEvent.MOUSE_UP, StopDrag);

private function StartDrag( event:MouseEvent )
{       
                       
  trace ("Start Drag");
  m_Sprite.startDrag();
}
private function StopDrag( event:MouseEvent )
{
      //My click function get called when this function is called                       
      trace ("StopDrag");
      m_Sprite.stopDrag();
}


actionscript3

Please reply at our Forum

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

© 2007 ActionScript 3.0