Posted By

peterbelsky on 01/20/11


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

kure69
carface
merritt212


drag scroll


 / Published in: ActionScript 3
 

  1. var leftX:int = -3000;
  2. var rightX:int = stage.stageWidth + 2000;
  3. //_pressHolder.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
  4. //_pressHolder.addEventListener(MouseEvent.MOUSE_UP, onUp);
  5. function onDown(e:MouseEvent):void
  6. {
  7. var constrainY:Rectangle = new Rectangle(leftX,e.currentTarget.y,rightX,0);
  8. e.currentTarget.startDrag(false, constrainY);
  9. }
  10. function onUp(e:MouseEvent):void
  11. {
  12. e.currentTarget.stopDrag();
  13. }

Report this snippet  

You need to login to post a comment.