Volume Knob Jumps , Plz Advise
hi , i have a movie with a volume knob as a master volume , and it works good for one version , but not in the final version ... when the user clicks the lower right of the knob , it will " jump " to that position , bypassing the user's "drag" and therefore making it very jerky and unprofessional . i have this code , i was wondering ifanyone could help me so that only "drags" are recognized ? : Action script : /*set maximum rotation of the knob.read initial volume of sound and set corresponding position of knob.*/onClipEvent(load){//maximum angle of rotation for the knobmaxRotAngle = 120;//read the initial volume & set the position of the knobthis.rotbutton._rotation = (2*_root.s.getVolume() - 100)*maxRotAngle/100;//read the initial pan and set the position of the knob//this.rotbutton._rotation = _root.s.getPan() * maxRotAngle/100;}/*set the volume depending on the position of the knobuse forumla to convert _rotation into volume or pan range*/onClipEvent(enterFrame){if (rotbutton.dorotate) {_root.s.setVolume(Math.floor((100+this.rotbutton._ rotation/maxRotAngle*100)/2));//_root.s.setPan(Math.floor((this.rotbutton._rotatio n/maxRotAngle*100)));}//update readouts..._root.sovolume = _root.s.getVolume();_root.dialangle = this.rotbutton._rotation;}
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 05-29-2005, 08:21 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Volume Knob And Volume Display
I am creating a mp3 player. I have a functional volume knob. I want it to control a movieclip which shows the status of the volume when the knob is rotated.
_X _Y Volume Knob.
Hello,
I am using flash MX and would like to make a volume knob that appears simular to "PAN" knob on the flash samples that come with Flash MX.
http://www.macromedia.com/desdev/mx/...ompletion.html
I have played around with the action script on the sample and am having a hard time with the actual action of the knob.
The sample knob changes the pan from left to right as the mouse moves futher to the left or right after clicking. If you click on the point of the knob and try to move it it moves very awkwardly because it is not built to be changed by clicking on the actual knob head.
I think it is because the action script does not use the _y coordinance with the _x. How would I implement the _y in the below script.
Code:
onClipEvent (load) {
increment = 0.01;
level = _parent.panSetting;
//
panKnob.onPress = function() {
if (Key.isDown(Key.getCode(18))) {
autoPan = true;
} else {
autoPan = false;
start = _root._xmouse;
newStart = panKnob._rotation;
dragging = true;
}
};
panKnob.onRelease = function() {
dragging = false;
};
panKnob.onReleaseOutside = function() {
dragging = false;
};
}
//
onClipEvent (enterFrame) {
if (dragging) {
pivot = (_root._xmouse-start)*2+newStart;
panKnob._rotation = pivot;
if (pivot<-155) {
panKnob._rotation = -155;
}
if (pivot>135) {
panKnob._rotation = 135;
}
level = Math.round(panKnob._rotation/1.35);
} else {
if (autoPan) {
textInput.value.selectable = false;
level += increment;
if (level>99 || level<-99) {
increment *= -1;
}
} else {
textInput.value.selectable = true;
}
if (level>100) {
level = 100;
//} else if (level<-100) {
//level = -100;
} else if (level<=100 && level>=-100) {
panKnob._rotation = level*1.35;
}
}
_parent.channel.s.setPan(level);
}
I am sorry if I sound really confuing. I am pretty new to al of this and am anxious to learn.
If their is a tutorial or somthing on this I would be very interested, or if someone could explain to me what needs to be done.
Thanks in advance for all of your help.
Volume Knob
hi , im relearning flash MX 2004 (AS 2.0 ) , and its been a while ;
i need to know of a tutorial or the code to go with my animation for a volume knob for my music ...
well i found a seemingly good tutorial , however i must have strayed somewhere because it loops my animation on keyframes 2 and 3 of the action script . it says it will do this indefinitely , however it also says it will play the music correctly and only loop between frames 2 and 3 for volume retreival purposes .
i've posted my .fla in MX 2004 here : http://www.dimmy.biz/volproblem.zip (someone on the forums was kind enough to lend me webspace so here it is thanks in advance if anyone knows how to correct the problem .
Volume Knob
hi , im relearning flash MX 2004 (AS 2.0 ) , and its been a while ;
i need to know of a tutorial or the code to go with my animation for a volume knob for my music ...
well i found a seemingly good tutorial , however i must have strayed somewhere because it loops my animation on keyframes 2 and 3 of the action script . it says it will do this indefinitely , however it also says it will play the music correctly and only loop between frames 2 and 3 for volume retreival purposes .
i've posted my .fla in MX 2004 here : http://www.dimmy.biz/volproblem.zip (someone on the forums was kind enough to lend me webspace so here it is thanks in advance if anyone knows how to correct the problem .
Volume Knob To Control A MC
Hi... Im building a site, and I need to stream some .mp3.
Iīve placed them inside a .swf, and then use the loadmovie to hear them. Is that right??... It works but Iīve never done this, so Im a little suspicious. I always let the whole mp3 load with the main swf, so using the loadmovie is new to me.
Am I on the right way?
OK... so thatīs my first question.
My second question is this. I want to be able to control the volume, but I donīt know how to link it to a swf loaded with loadmovie. Again, Iīve done this volume thing with mp3 loaded directy with the main swf. But now i cant.
Thanks
Volume Control Knob
I have a very basic understanding of AS, but I just can't seem to get this to work.
I'm trying to figure out how to get an audio control knob that I found on Sonify.com (http://www.sonify.org/home/feature/r...ogy/010_knobs/) to work with a flash player that uses xml to load mp3's. I have had little success so far. Does anyone have any ideas? The basic player I am working with can be found at Flash Kit (http://www.flashkit.com/movies/Scrip...8522/index.php)
Turning Volume Knob
I've looked around for a turning volume knob like this one:
http://www.sonify.org/home/feature/r...ogy/010_knobs/
but that's not a proper tutorial with description and all but, not only that, I've never been able to get the _rotate property to work.
Does anyone have, know a place that has or knows how to create that kind of button?
Thank you !
Volume Knob Using Png Sequence
Hello All,
I have a streaming FLV place in my Flash file with No SKIN.
I also have a png sequence of a volume knob turning from left to right
I want to create a volume control for the video where i click and drag on the image of the knob and depending if i drag the mouse right or left the image of the knob changes to the next or previous frame and also controls the volume of the video. In Simpler terms. If i click and drag to the right the knob turns to the right. If i click and drag to the left the knob turns left. And specifically with an image sequence (So it's more like a movieClip sccrubber)
Anyone knows how i can do this?
thx
Volume Knob Doesn't Disappear
I've been creating a custom FLV player, and I've been doing a descent job. However, when the FLV player exits the main timeline it leaves the volume knob on the main timeline (the black triangle). The strange thing is that the volume bar itself disappears, its the volume knob that doesn't get removed. I don't know how this happens since I only have the volume bar on one frame and when the FLV exits the volume bar isn't even there. Any suggestions?
Scripting A Volume KNOB In Flash MX
Hello all!
Obelisk here. I've designed a really cool "stereo component" looking navigation system for a possible client, and I would like to make the volume knob actually work.
I've been writing a few things down on how I would approach this, but I wanted to pose it to the users on Ultrashock. I'm sure I'm not the only one who thought of doing this.
Besides, once I figure it out, I'll post what I've learned up here for everyone to see and learn from.
Remember, Volume 0 isn't straight down, it's diagonally down and left, and Volume 10 (max) is diagonally down and right. If you need a graphic for reference, please e-mail me at the below address, and I'll send you what you need.
E-MAIL ADDRESS:
brian@briankjames.com
I hope to hear from you all soon! I'd especially like to hear from Mr. Robert Penner on this... I looked for your book this past weekend, and the store I go to doesn't have it in yet. I WILL get it though!!
Thanks all! Ciao!
Sincerely,
Obelisk (Brian)
P.S. E-mail me from my website if you want... www.briankjames.com
Volume Spits Or Jumps Down
I've been using this code on a volume fader:
ActionScript Code:
top = vol2._y;
left = vol2._x;
right = vol2._x;
bottom = vol2._y+100;
FXlevel = 50;
//
vol2.onPress = function() {
startDrag("vol2", false, left, top, right, bottom);
dragging = true;
};
vol2.onRelease = function() {
stopDrag();
dragging = false;
};
vol2.onReleaseOutside = function() {
dragging = false;
};
//
this.onEnterFrame = function() {
if (dragging) {
FXlevel = 100-(vol2._y-top);
} else {
if (FXlevel>100) {
FXlevel = 100;
} else if (FXlevel<0) {
FXlevel = 0;
} else {
vol2._y = -FXlevel+100+top;
}
}
_global.DUNK2.setVolume(FXlevel);
_global.THROW1.setVolume(FXlevel);
};
the fader works fine for setting the level of audio, but the problem is that whenever I come back into the frame the fader is on, even though I have inserted a frame for the length of my whole swf on the fader's layer, the audio seems to be really loud for a split second - almost like the code isn't taking effect right away in putting the volume where the fader is set
I thought that maybe I could fix this by setting the initial volume to around zero, so that if the code was taking a moment to execute it would err on the side of being quiet, thereby fixing the popping sound, but it's still there, just not as pronounced
is this method the best to use? has anyone else encountered this problem?
why is it happening and is there any way to fix it?
[MX04] Volume Control Using Knob That Rotates 180 Degrees
Been trying to figure this out.. and i can't seem to get there... probably because i can't do the math necessary. I need to create a radial knob volume control. I have been through Kennyb's tutorials, and done all my searching through the forums and everywhere else... and still no luck. Only way i can think of that might possibly work is to have the knob on a guide layer or something, but i can't figure out how to adjust the volume according to both x & y position.
an ideas, thoughts or suggestions are appreciated.
Thanks in advance
M
Flash CS3 AS3 - Model-View-Controller Volume Knob
Hello,
I created a very basic volume knob component using the MVC design pattern. I am attaching the files and am hoping that any AS3 OOP gurus out there will critique the code. Any criticism or advice would be awesome! I've just been reading about the MVC pattern out of two books (ActionScript 3.0 Design Patterns, and Advanced ActionScript 3 with Design Patterns).
One specific question is am I using interfaces correctly?
Thanks and feel free to copy the files for your own use, if they can be useful at all.
-Mike
Source files: http://www.miketmoore.com/kirupa_source/volumeKnob1.zip
How Do I Get The Volume Slider To Start At 50% Volume Instead Of 100% Volume?
I have code that sets the volume for the audio clips that I have loaded:
onClipEvent(load)
{
_root.soundstatus="on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
_root.maxvolume=100;
_root.minvolume=0;
}
onClipEvent(enterFrame)
{
//if(_root.soundstatus=="on") {step=5}
//if(_root.soundstatus=="off") {step=-5}
//_root.maxvolume+=step;
if (_root.maxvolume>100) {_root.maxvolume=100;}
if (_root.maxvolume<0) {_root.maxvolume=0;}
_root.mySound.setVolume(_root.maxvolume);
_root.mySound2.setVolume(_root.maxvolume);
_root.mySound3.setVolume(_root.maxvolume);
_root.mySound4.setVolume(_root.maxvolume);
_root.mySound5.setVolume(_root.maxvolume);
}
I then setup a slider bar to adjust the volume:
onClipEvent (enterFrame) {
_root.maxvolume=this._x
trace(this._x)
}
Then I set the volume based on the dragging of the slider bar:
on (press) {
if(_root.soundstatus <> "off"){
startDrag(this, false, 1, 0, 100, 0)}
}
on (release) {
if(_root.soundstatus <> "off"){
stopDrag()}
}
The issue is that I cannot start the audio volume and slider at 50% of volume instead of 100%. Can someone please look at this code and help me understand how I can load this script so the slider volume starts at 50% not 100%? Thank you.
How Do I Get The Volume Slider To Start At 50% Volume Instead Of 100% Volume?
I have code that sets the volume for the audio clips that I have loaded:
onClipEvent(load)
{
_root.soundstatus="on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
_root.maxvolume=100;
_root.minvolume=0;
}
onClipEvent(enterFrame)
{
//if(_root.soundstatus=="on") {step=5}
//if(_root.soundstatus=="off") {step=-5}
//_root.maxvolume+=step;
if (_root.maxvolume>100) {_root.maxvolume=100;}
if (_root.maxvolume<0) {_root.maxvolume=0;}
_root.mySound.setVolume(_root.maxvolume);
_root.mySound2.setVolume(_root.maxvolume);
_root.mySound3.setVolume(_root.maxvolume);
_root.mySound4.setVolume(_root.maxvolume);
_root.mySound5.setVolume(_root.maxvolume);
}
I then setup a slider bar to adjust the volume:
onClipEvent (enterFrame) {
_root.maxvolume=this._x
trace(this._x)
}
Then I set the volume based on the dragging of the slider bar:
on (press) {
if(_root.soundstatus <> "off"){
startDrag(this, false, 1, 0, 100, 0)}
}
on (release) {
if(_root.soundstatus <> "off"){
stopDrag()}
}
The issue is that I cannot start the audio volume and slider at 50% of volume instead of 100%. Can someone please look at this code and help me understand how I can load this script so the slider volume starts at 50% not 100%? Thank you.
Knob-pan
can any one show me how it work
i want to know how to link picture to it so when i turn the knob, picture slide across like a slide show.
Pan Knob Help
In flash's common libraries/buttons/classic/faders and knobs there is a pan knob
which looks really cool. I do not have a clue as how to program it to pan a sound though. Probably rotation and a bit of math ??
Any help is greatly appreciated.
Turning A Knob...
does anyone know the scripting to turning a round knob left and right, like a door knob or volume control type...?
need it asap..
thx...
Rotating Knob
I am working on a navigation system based on a rotating knob.
http://http://www.sonify.org/home/fe...obs/page3.html
The knob rotates to the users mouse position when the user clicks. Is there a script that will allow the knob to rotates from that position with the users mouse, rather than to that position and then with the users mouse?
[F8] Knob Incraments
I'v seen meny knobs out there, but nun that increments a value up or down dependering on a infinite rotation. All I see is that it will show the angle at which it points. I want to make a knob that adds or subtracts a value depending on it direction of its rotation infinitely.
I'm trying it out for my self in thought, but I havent came up with a work around for when the number gos from 360 to 0.
I'm sure some one out there allready has a working idea?
[F8] Scripting The Pan Knob
I am using the pan knob from Flash 8 common libraries/buttons. I'm a little lost on how to script this thing for panning of sound on my sound object. I know I need to probably use the rotation property. But I don't know jack about this.So I anyone can point me to a tutorial or help me out.
Thanks
JamesLoacher
Knob GUI Equation
Okay....I've got a knob....that I can turn clockwise from 7o'clock to 5o'clock.
The 7 o'clock value is 20...the 5o'clock value is 20000.
at 8'oclock the value should APPROXIMATELY 40
9o'clock=80
10o'clock=160
11o'clock=320
12o'clock=640
1o'clock=1280
2o'clock=2560
3o'clock=5120
4o'clock=10240
i've currently got my knob returning values between 0 and 1....
does anybody have any idea what equation that would be to make the knob have more of an exponential effect??
Knob/wheel...Help?
Hey!
I'm new to the boards, so Hi I got a little Problem! I would like to create a knob or wheel with which I can scale/zoom in on a map. Somehow I can't figure out how to make the knob look and feel the way I want it to (see jpeg). And on the other hand it behaves weird. I want it to start to left, and because it will be for a touchscreen, I would like to just have to drag the little dot. Now you have to click twice! I know, it's a lot I'm asking, but I really need your help to get it done for my Thesis. So hopefully you'll have some suggestions...
I attached the fla in the zip folder and the pictures show how the wheel should look like...It's a clock, where you "mark" time, and I don't really know how to accomplish that!!!
Knob Scrollbar
this will be a different type of scrollbar. it kinda isnt a bar at all. i want it so it is like a knob of a old tv. you know a circle then when you click on it and spin it to the side and it will scroll the text if you know what i mean.
cheers,
michael
Rotating Knob From AS2 --> AS3 Help Please
I'm trying to create a rotating knob that a User can turn with the mouse. The initial code worked in AS2 but the rest of my project is in AS3. so I started to convert it over (with help) Can anybody help make it work in AS3?
I'm sure the "update Advent" is incorrect. also i would like to have the knob only able to rotate 180 deg from initial position. I'm thinking i need to fid the initial x,y position and the final x, y position and use those as bounderies but not sure if there is a way to do it with rotation<180 type of thing. thank you in advance for any help, or direction.
Attach Code
this.knob.addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(evt:Event):void {
if (this.ok) {
var xVar = this.mouseX-this.x;
var yVar = this.mouseY-this.y;
this._r = 180-(Math.atan2((xVar), (yVar))*(180/Math.PI));
this.rotation = this._r;
trace(this._r);
}
evt.updateAfterEvent();
}
this.knob.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
function onMouseDown(evt:MouseEvent):void {
if (this.hitTest(this.mouseX, this.mouseY, 1)) {
this.ok = true;
}
}
this.knob.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
function onMouseUp(evt:MouseEvent):void {
this.ok = false;
}
Edited: 12/28/2007 at 08:36:47 AM by Rocker69
Knob Button
can anybody please help me to make a knob button that continuosly increases the value in clockwise rotation and on anticlockwise roatation decreases the value
Knob Button
can anybody please help me to make a knob button that continuosly increases the value in clockwise rotation and on anticlockwise roatation decreases the value
Question In Button - Knob Pan
This button that we have in the Flash MX is like a Volume Button.
My question is. How can i work with the values that apear when we click on it ?
Lets supose i want that the button do something when he rech the 40 value.
Play a sound, change a label of a text box or something like that. What can i do ???
Best Regards
Script For Turning A Knob
does anyone know the scripting to turning a round knob left and right, like a door knob or volume control type...?
need it asap..
thx...
using marcromedia flash MX
Creating A Knob Or Dial
I'm trying to create a movieclip/button that acts as a knob or dial.
Does anyone know of a tutorial on making one of these that works better than the knob button that comes with FlashMX's shared buttons library? I want to make something like that but that one just doesn't work very well.
Mainly I need to create a knob that allows the user to turn it within a range of zero to eight or one to nine... in other words, it needs nine levels or stopping points.
Any help is appreciated.
How To Code Radio Knob ?
I am going to create a navigation where you have a radio knob and when you click and move it, it moves to a notch - there will be about 5 notches. I don't want just mouse over and the radio knob moves, I want to be able to have it so you have to click and move the knob. I have Flash MX, how do I go about creating this ? any similar tutorials on this anywhere ? thx
Pan Knob Not Working With LoadMovie
Hi all,
I have a mixer that loads 4 sounds into 4 mc holders. Then I've used actionscript with a knob to control the pan of each sound. It works great on it's own, but when I export the mixer.swf and try to load it into my main movie using loadMovie in an empty mc, the pan won't work. The sounds play, the volume sliders will work, but not the pans.
Here is pan script for my sound instance "soundtrack":
onClipEvent(load){
maxRotAngle = 120;
this.rotbutton._rotation = _root.soundtrack.getPan() * maxRotAngle/100;
}
onClipEvent(enterFrame){
if (rotbutton.dorotate) {
_root.soundtrack.setPan(Math.floor((this.rotbutton ._rotation/maxRotAngle*100)));
}
_root.sovolume = _root.soundtrack.getPan();
_root.dialangle = this.rotbutton._rotation;
}
Am I missing something with the _root or something?
Rick
Knob That Outputs Data
I have a knob already created but am totally stumped on how I can make it output a set of numbers between -25 and +25. I have attempted some setinterval with no luck... most likely doing it wrong.
Dial-jog/shuttle Knob Help
Hi,
i've been following this tutorial on how to get a working shuttle knob:
http://www.designcontest.net/tutorials/volumedial/index.html
but i have a problem (don't we all): i wanted that when the user turned the knob clockwise the knob value would increment and when the user turned counter-clockwise the knob vlaue wound decrement. well.. that tutorial does it well except when the knob reaches it's start position and the knob value gets resetted to 0...
this is really bugging me since i wanted it to just keep incrementing/decrementing the value as the user would turn freelly the knob and not reseting it when it reached the first position..
can anyone help me out?
thanks in advance
PS: pardon my english :$
Stop Rotating Knob
I am using the attached knob from a Kirupa post I found but I need it to stop rotating when it gets to 135 or -135. I have it working somewhat now but if you move the mouse quickly across the bottom of the knob it will jump to the other side. Does anyone know a way to stop it? Ideally I would like to be able to make it stop rotating without using stop drag at all.
r0.speed = Math.random()-.5;
r0.onPress = doDrag;
r0.onRelease = noDrag;
r0.onReleaseOutside = noDrag;
r0.onEnterFrame = move;
function doDrag() {
this.drag = true;
var dx = _xmouse-this._x;
var dy = _ymouse-this._y;
this.angle = Math.atan2(dy, dx);
}
function noDrag() {
this.drag = false;
}
function move() {
if (this.drag) {
var dx = _xmouse-this._x;
var dy = _ymouse-this._y;
var newAngle = Math.atan2(dy, dx);
this.speed = newAngle-this.angle;
this.angle = newAngle;
this._rotation += this.speed*180/Math.PI;
//if mouse goes past 135 or -135 stop
if (r0._rotation<-135) {
r0._rotation = -135;
this.drag = false;
}
if (r0._rotation>135) {
r0._rotation = 135;
this.drag = false;
}
_root.rot = this._rotation;
}
}
Knob That Controls Movement?
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?
Turning Knob Effect?
Im doing a site for a recording studio I want to make a turning knob effect which turns left and right depending on the position of the mouse.
basically the turning knob would rotate in place while the user navigates the site.
what script do I put on the instance?
Stop Rotating Knob
I am using the attached knob from a Kirupa post I found but I need it to stop rotating when it gets to 135 or -135. I have it working somewhat now but if you move the mouse quickly across the bottom of the knob it will jump to the other side. Does anyone know a way to stop it? Ideally I would like to be able to make it stop rotating without using stop drag at all.
r0.speed = Math.random()-.5;
r0.onPress = doDrag;
r0.onRelease = noDrag;
r0.onReleaseOutside = noDrag;
r0.onEnterFrame = move;
function doDrag() {
this.drag = true;
var dx = _xmouse-this._x;
var dy = _ymouse-this._y;
this.angle = Math.atan2(dy, dx);
}
function noDrag() {
this.drag = false;
}
function move() {
if (this.drag) {
var dx = _xmouse-this._x;
var dy = _ymouse-this._y;
var newAngle = Math.atan2(dy, dx);
this.speed = newAngle-this.angle;
this.angle = newAngle;
this._rotation += this.speed*180/Math.PI;
//if mouse goes past 135 or -135 stop
if (r0._rotation<-135) {
r0._rotation = -135;
this.drag = false;
}
if (r0._rotation>135) {
r0._rotation = 135;
this.drag = false;
}
_root.rot = this._rotation;
}
}
Flash 8 FLV Playback/Custom UI Volume Components With Global Volume Control
I'm creating a multi-scene swf with several FLV Playback - Player 8 Component videos on different scenes/frames.
I want to use the FLV Playback Custom UI Volume Bar so that when a user makes a volume adjustment during one FLV Playback viewing that volume adjustment will remain throughout the other FLV Playback video viewings.
This will prevent the viewer from having to make volume adjustments for each viewing. However, I want to enable the volume change to be made and changed at any time throughout any of the video viewings. Another aspect of this is that the FLV Playback Component has a volume setting that would have to be overridden by the global custom UI volume setting.
Is this possible? If so, how would this be done?
Thanks!
James
jamesk@pacificmm.com
[F8] FLV Playback/Custom UI Volume Components With Global Volume Control
I'm creating a multi-scene swf with several FLV Playback - Player 8 Component videos on different scenes/frames.
I want to use the FLV Playback Custom UI Volume Bar so that when a user makes a volume adjustment during one FLV Playback viewing that volume adjustment will remain throughout the other FLV Playback video viewings.
This will prevent the viewer from having to make volume adjustments for each viewing. However, I want to enable the volume change to be made and changed at any time throughout any of the video viewings. Another aspect of this is that the FLV Playback Component has a volume setting that would have to be overridden by the global custom UI volume setting.
Is this possible? If so, how would this be done?
Thanks!
James
jamesk@pacificmm.com
Microwave Knob: How To Make It Work?
HI
i am building a microwave knob, and the user has to put the cursor on the handle, and move it and the handle should move rotatively with the movement of the user.
now i did a simple path that rotates the handle 360 degrees, (bcs the button is a circle) but i can't figure out a good script that makes the handle move continiously. IS there an already made script somewhere?
Now on the knob there are multiple positions (position 0, 1 , 2, 3 and 4), and when the user reaches one of the positions with the handle, then something should happen (such as for instance a movie clip that will animate)
How do I do all that!?!!!!!!!!!!!
Pls help out
Microwave Knob : HOw Can I Make It Work?
HI
i am building a microwave knob, and the user has to put the cursor on the handle, and move it and the handle should move rotatively with the movement of the user.
now i did a simple path that rotates the handle 360 degrees, (bcs the button is a circle) but i can't figure out a good script that makes the handle move continiously. IS there an already made script somewhere?
Now on the knob there are multiple positions (position 0, 1 , 2, 3 and 4), and when the user reaches one of the positions with the handle, then something should happen (such as for instance a movie clip that will animate)
How do I do all that!?!!!!!!!!!!!
Pls help out
Knob Controlled News Component
OK Here is a drawing of how I want my news component to work:
I want to make this so the user can rotate the knob with the mouse in either direction and that will change the news MC on the right at certain degrees.
[F8] Turn Knob To Increase Or Decrease Var?
Hiya
I am trying to make a knob which can be turned by dragging and subsequently increase or decrease an arbitrary value depending upon the direction turned.
I've got the 'turning knob' part working, but am running into trouble applying its rotation to my variable.
I need to be able to accommodate an initialValue, minValue, and maxValue.
Here's what I have:
Code:
var mouseListener:Object = new Object();
var radians:Number;
var degrees:Number;
var down:Boolean = false;
var minLimit:Number=0; // could be anything
var maxLimit:Number=1200; // could be anything
var initValue:Number=10; // could be anything
var increment:Number;
clip.onPress = function() {
down = true;
};
clip.onRelease = clip.onReleaseOutside=function () {
down = false;
};
mouseListener.onMouseMove = function() {
if (down) {
radians = Math.atan2(_ymouse-clip._y, _xmouse-clip._x);
degrees = Math.round((radians*180/Math.PI));
increment = degrees;
if(degrees<0){
increment=((180+degrees)+180) // works up to 360 - what do I do after that?
}
clip._rotation = degrees;
test.text=increment;
}
};
Mouse.addListener(mouseListener)
Many Thanks in advance!
Spin Knob To Control Mc Frames. Mmm.
say I had this knob for twiddling:
panKnob.onRelease = function() {
dragging = false;
trace(panKnob._rotation);
_root.XXX = ((panKnob._rotation + 135)/270);
};
could I make XXX something so that the knob would end up cycling through frames of a movie clip?
I've got a bg mc (instance name 'chameleon') with just gradients and I'd like to experiment real-time to figure out some nice color combos, and I might just leave it on there if it's fun or whatever
I'd try chameleon.gotoAndStop.(Math.round(10%(panKnob._rot ation + 135)/270))));
... but I know that's retodded.
Music Player Slider Knob Help
My partner needs help with a music player he created for a site we are working on here is the code, we need to make the knob slide to change the location on the music currently palying like push it foward or backward with the knob im sure you guys knwo waht im talking about
ActionScript Code:
stop();
_root.createEmptyMovieClip("sound_mc", 1);
function timer(sound_obj) {
time = sound_obj.position/1000;
min = Math.floor(time/60);
min = (min<10) ? "0"+min : min;
sec = Math.floor(time%60);
sec = (sec<10) ? "0"+sec : sec;
timeDisplay_txt.text = min+":"+sec;
}
MovieClip.prototype.songStarter = function(type,path) {
if (this.sound_obj) {
this.sound_obj.stop();
delete this.sound_obj;
}
this.sound_obj = new Sound(this);
this.sound_obj.loadSound("http://localhost/undergroundHipHopOnline/Media?mode=listen&type="+type+"&path="+path,true);
//this.sound_obj.loadSound("http://www.undergroundhiphoponline.com/servlet/Media?mode=listen&type="+type+"&path="+path,true);
this.onEnterFrame = function() {
if (this.sound_obj.position>0) {
delete this.onEnterFrame;
timeInterval = setInterval(timer, 1000, this.sound_obj);
}
};
this.sound_obj.onSoundComplete = function() {
clearInterval(timeInterval);
this._parent._parent.timeDisplay_txt.text = "00:00";
//_root.sound_mc.timeDisplay_txt.text = "00:00";
//timeDisplay_txt.text = "00:00";
};
this._parent.volume1.dragger.onPress = function() {
startDrag(this, true, 0, this._y, this._parent.volBG._width, this._y);
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() {
stopDrag();
};
this.tracker.knob.onPress = function() {
startDrag(this, true, 0, this._y, this.tracker.line._width, this._y);
this.onEnterFrame = function() {
//var p = (this._x/this._parent.track_line._width)*100;
//this._parent._parent.sound_mc.sound_obj.setVolume(p);
};
};
// our lame attempt to get the knob to follow suite of the volume control as
// far as how you can drag the volume from one side to the other
// we need to be able to do that with the music knob to control the music playing
this.tracker.knob.onRelease = function() {
delete this.onEnterFrame;
stopDrag();
};
this.tracker.knob.onReleaseOutside = function() {
stopDrag();
};
};
btn_play.onRelease = function() {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text = "00:00";
_root.sound_mc.songStarter(type, path);
};
btn_stop.onRelease = function() {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text = "00:00";
this._parent.sound_mc.sound_obj.stop();
};
_root.sound_mc.songStarter(type, path);
I can send the FLA to in neccesary its not a big file
this is my first day on here you guys are so helpful
please dont just send me a link though kinda explain it if you have time
V's Streaming Player + Knob Control
I have voetsjoeba's streaming player http://www.voetsjoeba.com/lab.php?i=8
which i modified slightly. I want to control volume with a knob instead of a slider.
my player is attached.
here is the code for the knob:
-------------------------------------------------------
r0.speed = Math.random()-.5;
r0.onPress = doDrag;
r0.onRelease = noDrag;
r0.onReleaseOutside = noDrag;
r0.onEnterFrame = move;
function doDrag() {
this.drag = true;
var dx = _xmouse-this._x;
var dy = _ymouse-this._y;
this.angle = Math.atan2(dy, dx);
}
function noDrag() {
this.drag = false;
}
function move() {
if (this.drag) {
var dx = _xmouse-this._x;
var dy = _ymouse-this._y;
var newAngle = Math.atan2(dy, dx);
this.speed = newAngle-this.angle;
this.angle = newAngle;
this._rotation += this.speed*180/Math.PI;
_root.rot = this._rotation;
}
}
----------------------------------------------------------------
thanks for your help!!!
peace,
hondo311
Creating Turning Knob Using Pictures
Hi,
I have a series of 11 pictures, showing a knob turning. I've loaded these 11 pictures into 11 frames respectively. What I need to do now is to be able to drag the knob when the mouse is pressed and moved. And whenever the mouse is dragged, the knob will be turned to the next frame, showing the next picture. I hope to achieve a smooth turning knob, just like the one in this website:
http://mysite.wanadoo-members.co.uk/BBGorB/HSGenerator.swf
Here's my code (the knob does not run smoothly):
on(releaseOutside){
stop();
}
on(press){
var mousePos = _ymouse;
var mousexPos = _xmouse;
}
on(release){
if(_ymouse > mousePos || _xmouse < mousexPos){
nextFrame();
}else{
prevFrame();
}
}
Can someone please help me....
thanks a million.
V's Streaming Player + Knob Control
I have voetsjoeba's streaming player http://www.voetsjoeba.com/lab.php?i=8
which i modified slightly. I want to control volume with a knob instead of a slider.
my player is attached.
here is the code for the knob:
-------------------------------------------------------
r0.speed = Math.random()-.5;
r0.onPress = doDrag;
r0.onRelease = noDrag;
r0.onReleaseOutside = noDrag;
r0.onEnterFrame = move;
function doDrag() {
this.drag = true;
var dx = _xmouse-this._x;
var dy = _ymouse-this._y;
this.angle = Math.atan2(dy, dx);
}
function noDrag() {
this.drag = false;
}
function move() {
if (this.drag) {
var dx = _xmouse-this._x;
var dy = _ymouse-this._y;
var newAngle = Math.atan2(dy, dx);
this.speed = newAngle-this.angle;
this.angle = newAngle;
this._rotation += this.speed*180/Math.PI;
_root.rot = this._rotation;
}
}
----------------------------------------------------------------
thanks for your help!!!
peace,
hondo311
|