-
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 (0, 0, 180, 0); Mc_DialBtn.addEventListener(MouseEvent.MOUSE_DOWN, dialBtnDown); function dialBtnDown(event:MouseEvent):void{ Mc_Dial.startDrag(false, sliderBind); } Mc_DialBtn.stage.addEventListener(MouseEvent.MOUSE_UP, dialBtnUp); 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.
-
.
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
-
.
Hi,
Make something of this.
-
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.
-
.
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|