Skip to main content
Participant
September 12, 2006
Question

startDrag no diagonal

  • September 12, 2006
  • 2 replies
  • 276 views
Is there a way to restrict startDrag's movement to just the x and y axis with no diagonal movement?
This topic has been closed for replies.

2 replies

Participant
September 12, 2006
Hey thanks for the response kglad! I would like to restrict movement to only x AND y as if the mc was on an imaginary grid.

I have an example of the array for my x and y grid...
*******
//left to right
pointsX = [2400, 1400, 400, -1400, -2400];
//bottom to top
pointsY = [2300, 1300, 300, -1300, -2300];
*******

I would llike to restrict the drag to ONLY be on a x or y coordinate within the "grid" array.

How would I "fake it"?
kglad
Community Expert
Community Expert
September 13, 2006
normally, the upper left corner of the stage is 0,0 with increasing x to the right and increasing y down. if you had two arrays with that contained on-stage points, you could fake it with:


kglad
Community Expert
Community Expert
September 12, 2006
no. but you can fake it by having your movieclip move alone the x and y axis (whatever you mean by that) after it undergoes a mouse event.