Jump to content


volume knob


  • You cannot reply to this topic
9 replies to this topic

#1 boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 21 July 2006 - 12:49 AM

Hi guys,

Much gratitude for your mp3 player tutorial! I've designed my player with a rotating volume knob, rather than a slider - any chance you could show me how to change the slider code to a rotating knob?

Thanks again!

boogooloo1 :o

#2 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 21 July 2006 - 09:31 AM

http://www.sonify.org/home/feature/remixol...nobs/page2.html

#3 boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 21 July 2006 - 05:29 PM

Hi funkysoul,

Yep, I've already check that out, and made my own knob to those specs, which rotates etc - can't figure out how to assign it to the XML, rather though? At the moment, it's assigned to a single sound (mp3).

<_<

Edited by boogooloo1, 21 July 2006 - 05:29 PM.


#4 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 21 July 2006 - 08:35 PM

just assign the final value conformed value of the noise to a variable called "p" ( in my case)

this.onEnterFrame = function() {
			var p = Math.floor((100+rotbutton._rotation/maxRotAngle*100)/2);
			this._parent._parent.sound_mc.sound_obj.setVolume(p);

Edited by funkysoul, 21 July 2006 - 08:35 PM.


#5 boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 21 July 2006 - 08:58 PM

Hmmm, where do I put that code - in the main actionscript? And I delete all the volume dragger stuff?

:D

#6 boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 21 July 2006 - 11:02 PM

(it's probably too obvious to mention that I know pretty much nothing about Actionscript - I've just followed your instructions to this point)

:D

#7 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 22 July 2006 - 06:37 AM

I need a bit more time to configure the player with the knob... too busy atm for that

#8 boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 22 July 2006 - 10:15 AM

No probs, funkysoul - I've got this thread emailing me on replies, so hopefully you'll get to it when you can!

^_^

#9 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 24 July 2006 - 06:59 AM

ok, let's start by grabbing your knob fla you did from the tutorial, open the mp3player, create a new empty movieclip and name it knob.

Now open the knob file and select only the knob (instancename voldial), nothing else. Copy and Paste it into the mp3 player.

now let's get to the code:

remove this lines, from the root timeline (frame1)
this._parent.volume1.dragger.onPress = function() {
		startDrag(this, true, 0, this._y, this._parent.volBG._width, this._y);
		_root.toolTip._visible = true;
		setInterval(draggableTip, 100);
		function draggableTip() {
			_root.toolTip._x = _root._xmouse;
		}
		this.onEnterFrame = function() {
			var p = (this._x/this._parent.volBG._width)*100;
			this._parent._parent.sound_mc.sound_obj.setVolume(p);
		};
	};
	this._parent.volume1.dragger.onRelease = function() {
		delete this.onEnterFrame;
		stopDrag();
	};
	this._parent.volume1.dragger.onReleaseOutside = function() {
		_root.toolTip._visible = false;
		stopDrag();
	};
also don't forget to remove the volumebar graphs -_-

line 62:
this.sound_obj.setVolume(50);
set the starting volume at 50 or whatever you like.

select the knob mc, double click it and select the voldialmc on the stage press F9 and replace the actionscript with this:
onClipEvent(load){
	maxRotAngle = 120;
}
onClipEvent(enterFrame){
	if (rotbutton.dorotate) {
		_root.sound_mc.sound_obj.setVolume(Math.floor((100+this.rotbutton._rotation/maxRotAngle*100)/2));
	}
}

As you noticed I remove the line which would gather the volume of the mp3, problem is that the action wich tries to get the volume comes to place before the mp3 is loaded, causing an error all the time. Just a small way to trick it out, position the knob at position 50 and put the knob at middle way

don't have the time at the moment to fix that small bug.

Hope it works for you, if you have any questions then post it here :)

Funkysoul

Edited by funkysoul, 24 July 2006 - 06:59 AM.


#10 boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 24 July 2006 - 07:23 AM

Hi Funkysoul,

If you ever need a kidney, liver or other vital organ, let me know... -_- :)

Thank you VERY much - that works perfectly!!!!! In fact, I don't even understand what you mean about the error message, but that's fine with me, because I'm not getting any errors anyway.

Much appreciated, and sorry for hassling you!

:D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users