A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: startDrag with a circular bind

  1. #1
    Junior Member
    Join Date
    Jul 2015
    Posts
    8

    startDrag with a circular bind

    Does anyone know how to perform a startDrag with a circular bind?

    So far I have the following code, but it can only do a rectangular bind for a slider button. But I also have a circular "dial" type of button. I can't figure out how to make a drag on MOUSE_DOWN and have the button bind to a circular dial.

    This is what I have for a slider button (much like the iPhone unlock screen button):
    PHP Code:
    var sliderBind:Rectangle = new Rectangle (001800);
    Mc_DialBtn.addEventListener(MouseEvent.MOUSE_DOWNdialBtnDown);
    function 
    dialBtnDown(event:MouseEvent):void{
       
    Mc_Dial.startDrag(falsesliderBind);
    }
    Mc_DialBtn.stage.addEventListener(MouseEvent.MOUSE_UPdialBtnUp);
    function 
    dialBtnUp(event:MouseEvent):void{
       
    Mc_Dial.stopDrag();

    It works great for sliding the button side to side, as you can see with the sliderBind (xLeft, yUp, xRight, yDown), it's bound because there's no y. But if I add y values, then the drag is everywhere in those perimeters.

    I also tried changing the .startDrag to a .rotate but I can only get it to rotate in one direction with every click, I want to drag it.
    Last edited by WarriorDex84; 08-28-2015 at 12:18 PM.

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    I have code to do this but perhaps its easier and better for you to send you to some pages.

    http://www.soundstep.com/blog/2011/0...le-or-ellipse/ check demo

    http://www.flashperfection.com/tutor...as3-38351.html

  3. #3
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Make something of this.

  4. #4
    Junior Member
    Join Date
    Jul 2015
    Posts
    8
    Perfect, thank you fruitbeard.
    Those sites were exactly what I was looking for.

    I couldn't open your attachment though. For some reason, I get a "Unexpected format" error message when I try to open any downloaded files. Even the packages from those sites didn't work.

  5. #5
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    I suspect that is due to you using an older version of Flash.

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