A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: drag to single direction

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    8

    drag to single direction

    Hi All, can i ask how to limite a drag function to a single direction? which means I only can drag the button to left, it won't be able to drag to right.

    Please take a look the attached file.

    Appreciate for your help
    Attached Files Attached Files

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    when you set your drag parameters...

    keep updating the drag var to be the current position

    I would say probably doing so onMouseMove()..

  3. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    8

    Thanks a lot!

    Hi whispers, thanks for your reply, i have made some emendation, currently it works fine if i drag button to left and MouseUp, it won't be able to drag to right side, but while im dragging the button it still free to move both left and right direction, is there any way to set a limitation for that?

    Thanks a lot!
    Attached Files Attached Files

  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    try updating it more frequently..like onMouseMove();

    (like I suggested in my previous post)


  5. #5
    Junior Member
    Join Date
    Mar 2010
    Posts
    8
    Thanks, buddy, I will try it

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center