# Knob that controls movement?

**URL:** <https://forum.kirupa.com/t/knob-that-controls-movement/13574>\
**Category:** Uncategorized\
**Created:** [February 14, 2003, 8:29pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574 "2003-02-14T20:29:19Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivanwright](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ivanwright/32/119_2.png) [@ivanwright](https://forum.kirupa.com/u/ivanwright)\
**Post date:** [February 14, 2003, 8:29pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/1 "2003-02-14T20:29:19Z")

</div>

anyone know of any tutorials where you would have a knob, that when turned, would move a clip around the stage? kind of like on older stereos… you turn the knob and the line moves across the dial? anyone know of anything like that? am i making any sense?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 14, 2003, 8:36pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/2 "2003-02-14T20:36:44Z")

</div>

some clarification… in my head, you would turn the know by grabbing it with the mouse and dragging left or right… cause the movement of the clip…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 14, 2003, 9:54pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/3 "2003-02-14T21:54:58Z")

</div>

here is a knob example

this just turns a clip, not move a clip too. If you have troubles with that, say so and I (or someone else) can help

this has 2 knobs, one using left and right movement (common for computer knobs) and one using angle of mouse in rotation.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 14, 2003, 9:58pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/4 "2003-02-14T21:58:03Z")

</div>

thanks, i’ll let you know if this works out! anyone else that has anything, feel free to let me know

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 10:45am UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/5 "2003-08-30T10:45:53Z")

</div>

Hey Sen -  
I’ve made a knob and I’m trying to get a value off of it as it rotates. I made a textbox to see what the \_rotation value is, and when you pass 180 degrees (clockwise), it goes to -180 and counts up to -1. Do you know of a way for it to register a value between 0 and 360 based on the degrees? Or better yet, any value that remains positive. I’ve searched all over and can’t find my answer Ⓜ

Thank you!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 11:05am UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/6 "2003-08-30T11:05:48Z")

</div>

just use \_rotation +180 😉

if the \_rotation is -180, adding 180 makes it 0. if its 180, adding 180 gives you 360 - thereby making \_rotation+180 a range of 0-360

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 6:23pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/7 "2003-08-30T18:23:40Z")

</div>

But that doesn’t work because it goes, in order from 0-180 and then backwords from (-180) back to zero. If I just added 180 to the mix (which I tried along with a couple other frustrating things) it would go from 0-180 then 180 back to zero on the pos scale.

Basically, when the knob is pointing to the left, it should register 270 degrees, instead, it’s registering -90. I’ll post the example so you can see what I mean.

Thanks for helping, too!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 9:08pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/8 "2003-08-30T21:08:00Z")

</div>

[swf=“[http://www.freddythunder.com/test/controlknob.swf](http://www.freddythunder.com/test/controlknob.swf) width=400 height=400”][/swf]

See??

Here’s the fla:  
[http://www.freddythunder.com/test/controlknob.fla](http://www.freddythunder.com/test/controlknob.fla)

Thanks again. This one’s got me baffled

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 9:10pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/9 "2003-08-30T21:10:33Z")

</div>

freddy,  
if it is greater than 180, add it to 360. i have a fla as soon as i find it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 9:16pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/10 "2003-08-30T21:16:24Z")

</div>

here it is. other computer

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 9:26pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/11 "2003-08-30T21:26:47Z")

</div>

Aw crap…:sigh:  
I figured it had to be something simple, but my illogical no math havin’ brain couldn’t figure it out.

You said in your post if it’s greater than 180, but should be less than 0 because all the nums are neg.

Thank you grandsp5 - worked like a charm.

And thanks Sen! You were basically telling me the right thing, too. 🙂

And I’d like to thank God, and my parents, and Buddy Hill my agent…oh, sorry, got used to thanking people - thought I won an award…😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 10:20pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/12 "2003-08-30T22:20:08Z")

</div>

🙂 anytime

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 31, 2003, 3:22am UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/13 "2003-08-31T03:22:44Z")

</div>

Granted, I wanted this to work for a different project, but this popped into my head. I know my brother’s kids will get a kick out of it for a couple minutes - it is kinda pointless; but I wonder how many people would remember what this is:

[http://www.freddythunder.com/game/fredasketch.html](http://www.freddythunder.com/game/fredasketch.html)

The only bad thing is I can’t figure out a way to get boundries to work for it. I’ll figure it out eventually. It was a fun afternoon project if anything 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 31, 2003, 5:11pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/14 "2003-08-31T17:11:34Z")

</div>

how did you do that shake clear effect freddy where you shake the entire browser?? Thats very neat.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 1, 2003, 1:41am UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/15 "2003-09-01T01:41:42Z")

</div>

Yeah, I liked that effect. I found it here:  
[http://javascript.internet.com/bgeffects/shake-screen.html](http://javascript.internet.com/bgeffects/shake-screen.html)  
when I was learning javascript stuff. I thought it was funny…😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 1, 2003, 7:23am UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/16 "2003-09-01T07:23:39Z")

</div>

To make it more realistic make the lines fade out when you sjake it clear. Other wise its good.

Oh and the boundary thing, need to know a bit more about your setup to help you on that.

Viru.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 1, 2003, 5:51pm UTC](https://forum.kirupa.com/t/knob-that-controls-movement/13574/17 "2003-09-01T17:51:11Z")

</div>

You know, if you want to look at it, the fla’s right here:  
[http://www.freddythunder.com/game/fredasketch.fla](http://www.freddythunder.com/game/fredasketch.fla)

I tried a hitTest thing, didn’t work. I tried an if/else on the dot’s coords, that didn’t work. So, if you can get it to work, it would be pretty cool. And if not - no biggie…😛

I added the fading thing - nice addition!!
