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?
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…
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.
thanks, i’ll let you know if this works out! anyone else that has anything, feel free to let me know
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!!
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
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!
[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
Thanks again. This one’s got me baffled
freddy,
if it is greater than 180, add it to 360. i have a fla as soon as i find it.
here it is. other computer
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…
anytime
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
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
how did you do that shake clear effect freddy where you shake the entire browser?? Thats very neat.
Yeah, I liked that effect. I found it here:
http://javascript.internet.com/bgeffects/shake-screen.html
when I was learning javascript stuff. I thought it was funny…
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.
You know, if you want to look at it, the fla’s right here:
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!!