ActionScript 2.0 :: Mouse Position On Stage Dictating Volume Level?
May 30, 2007
i've got a MC named 'enterBtn', i want the volume of 'crowd.wav' to increase when the mouse moves towards 'enterBtn' and decrease when moving away. i don't know if this helps, but the co-ordinates of enterBtn are x =530, y = 344.
[Code]...
View 2 Replies
Similar Posts:
Jun 29, 2009
I am trying to create a soundscape of a photograph by making the volume of a sound increase as the cursor moves over a part of the photo which would make that sound. I am only interested in the X axis of the mouse position and know what I want my program to do but im having trouble coding it correctly. [code]...
View 2 Replies
Jul 24, 2011
Is there any code in as3 that sets the volume by x&y- coordinates of the mouse?So that my sound is in a MC, and how closer my mouse is at the MC, the louder the volume gets?
View 4 Replies
Nov 21, 2009
I've created a small music player with a sliding volume control. I'm having trouble with the volume. Though it does control volume properly, if I set the initial volume to less than 100%, the volume always starts at 100% until I move my mouse over the player. At that point, the volume changes to whatever the initial volume is set to.Is this a flash bug, or am I missing something? Here is the affected code (code for other buttons/functions omitted for brevity):
var song_initvolume:Number = 100;
slider_1._x = groove_1._x + song_initvolume;
playSong(0,song_play);[code]....
I'd like to be able to set the volume at say 50%, but the above mentioned behavior happens each time.
View 2 Replies
May 27, 2010
I can't get his to work like it works on this site...http:[url].....
View 9 Replies
Jun 6, 2010
I want to move the bg with mouse movement and use this code.
Code:
leftMouse = mask_mc._x;
rightMouse = mask_mc._x + mask_mc._width;
topMouse = mask_mc._y;
[Code].....
There are two movie clip one is mc and another one is mask_mc. I made the Registration point for both the movie clips to the left and tested locally and it seems OK when I am in the left edge, top edge or any edge the background is not visible and after that I uploaded to look how it goes. But I can see the background when the mouse is at the edges. How can i adjust the same?
My mask has a size of 1024 x 768 and the mc has a size of 1250 x 940.
View 8 Replies
Jan 21, 2007
Does anyone knows if it is possible to change the mouse position on the stage?
View 1 Replies
Jan 9, 2011
I want to record the mouse's position on stage on entering the stage with out having to move the mouse.
In example:
I want to have an event occur only if the mouse Y position is greater than 200 when entering the stage.
The only way i know to do is is setting up a MOUSE_MOVE type, mouse event.
here is my code:
var Timer_Down2:Timer = new Timer(10000)
stage.addEventListener(Event.ENTER_FRAME, slider_down);
function slider_down(event):void{
[Code].....
View 3 Replies
Jul 4, 2009
I am in learning phase but do not to show the x andy posion of mouse on the stage. I want to trace the x and y position of mouse in stage. How we can do this ?
View 3 Replies
May 4, 2009
Is there a way to configure/control the volume level of an mp3 that automatically plays in your flash segment? In other words I'd like for the volume to play at a 30 or 50% level.
View 6 Replies
Nov 25, 2011
I want to get the activity level of audio of a NetStream, similar to how you can do it with a Microphone.In this article,
[Code]...
View 2 Replies
Jul 22, 2009
Let's say I have a slider that can go between 0 and 1.The SoundTransform.volume also ranges between 0 (silent) and 1 (full volume),but if I use a linear function,let's say SoundTransform. volume = slider.volume, the result is rather not pleasing.I really haven't studied the human ear,but I overheard once that human perception is logarithmic, or something similar. What algorithms should I use for setting the SoundTransform.volume?
View 7 Replies
Jan 13, 2011
i want to control sound in my movie clip by the button which i designed in flash. for ex.: my default sound is 100% on home button & when i click on contact(last button) the volume level goes to 20% same as in between buttons.i use this script to call the sound in flash
bgSound = new Sound(this);
bgSound.attachSound("sound1");
bgSound.start(0,99);
now tell me what i put in buttons to manage sound level.
View 2 Replies
Mar 17, 2010
I am trying to execute code if the mouse is on a certain position in the stage, but the code should stop as soon as the mouse is pressed and then start again as soon as the mouse is released.Here is my code:
stage.addEventListener(MouseEvent.MOUSE_MOVE, mousePos);
function mousePos( e:MouseEvent ):void{[code].........
View 2 Replies
Mar 27, 2005
I have this code where the player can set their volume;
var my_sound:Sound = new Sound();
my_sound.loadSound("C://Documents and Settings/me.my-comp/My Documents/My Music/Unknown Artist/Unknown Album (8-09-2004 10-55-17 AM)/my_song.mp3", true);
this.createEmptyMovieClip("knob_mc", this.getNextHighestDepth(),0,0,140,64);
knob_mc.left = knob_mc._x;
knob_mc.right = knob_mc.left+100;
[Code] .....
OK, now the catch, this code works fine, however, how would I make it possible for the volume level to be retrieved in another frame and all the sounds in that frame are played at the set volume??
View 6 Replies
Feb 17, 2011
What's the correct way to track mouse position, from Adobe Flash, when someone has: Started a drag within the Flash application (a MOUSE_DOWN event), Dragged the mouse outside the app or even the browser window (a MOUSE_MOVE event), and Released the mouse button (a MOUSE_UP event)? For example (imagine Stack Overflow is a Flash application):
Within the app, I'm able to track the mouse X and Y positions with a MOUSE_MOVE event listener, but I lose it when it goes outside of the browser... So, how do I track the position of the mouse no matter where it goes? For a good example, try Google Finance. Try dragging the chart around; it'll still drag around if you move your mouse out of the browser window, and the mouse will be outside of the browser when you release it.
Also, check out KOKO KAKA; If you click on the scrollbar (make the browser window really small) and move outside of the browser window, the scroll bar moves just like a real one would. I believe both only work because the MOUSE_DOWN event "captures" the mouse, allowing the Flash application to track the position of the mouse even when it is outside of the browser.
View 2 Replies
Jun 24, 2010
I have designed a menu that When you mouse over it, a custom cursor appears. When you mouse down it disappears and when you mouse up it returns. If you happen to mouse down and then drag the mouse off of the menu (whilst in mouse down) and then mouse up outside the menu, the custom cursor disappears. All good. The only issue is: If you happen to mouse down on the menu and then drag the mouse off of the menu AND off of the stage, i.e the SWF (whilst in mouse down) and then mouse up completely off of the stage, the custom cursor appears at the point it left the menu. I have tried to fix this using MOUSE_LEAVE but this dosnt work when the mouse button is pressed down. I have attached an FLA, SWF and the AS below.
Code:
stop();
import com.greensock.*;
import com.greensock.easing.*;
import flash.events.MouseEvent;
[code]....
View 1 Replies
Feb 1, 2006
Basically the x position of the mouse should control the play position of a movie. Do I need something like an event handler (I'm not sure exactly what these do, but I've seen similar scripts that seem to use them).
View 2 Replies
Nov 12, 2009
I have an Input Text area that users can edit and then submit. I need to be able to show, on screen, the cursor's current position as they type. I don't need to know where the mouse is but all work-arounds I've found so far can only tell me the mouse position. The font for the text is 'courier' or 'courier new' and the Input Text area is scrollable.
View 8 Replies
Feb 9, 2011
i want to take btn1 position half wwidth of own x position on stage
View 1 Replies
Mar 28, 2010
tween from one position to mouse position
View 1 Replies
Oct 29, 2009
I have a map application that when I use the mouse wheel the map will scale up or scale down. The next thing I want to do is to focus on the mouse pointer while zooming on the part of the map.
I have this code...
function focusMousePosition(){ onMouseMove = function (){ Stage.width = _root._xmouse; Stage.height = _root._ymouse; updateAfterEvent(); }}
var mouseWheelListener = new Object();var wheelNum:Number;
mouseWheelListener.onMouseWheel = function(wheelNum){ focusMousePosition(); if (wheelNum > 0){ map._xscale *= 0.9; map._yscale *= 0.9; }else{ map._xscale *= 1.1; map._yscale *= 1.1; }}Mouse.addListener(mouseWheelListener);
View 3 Replies
Jan 13, 2011
I have a sprite that I zoom out using the sprite.z property. Once the z property has been modified the sprite x and Y values do not match the stage x and y real value. So far so good and what I was expecting!
What I want to accomplish is that when the user clicks the stage the sprite tweens to where the mouse was clicked but I don't know what x and y position to send to the sprite. ( since stage 200,200 is something like 400,400 for the sprite depending on z value)
I tried Utils3D.projectVector using Matrix3D of the perspectiveProjection of the stage without success. (i.e. I get Vector3D(Infinity, Infinity, NaN))
I could fallback to scalex/scaley but sprites.z gives me the correct scale, perspective projection, paralax scrolling since I have sprites on different z level all for free. I would have to recode all that.
View 5 Replies
Nov 3, 2009
lets say i have a sprite on the stage and one movieclip inside it. now i want to tween or just set that movieclip x and/or y position according to stage position. so for example i want to set mc.y = - 100; (by which i mean -100 to stage, not sprite which mc is in.)
View 2 Replies
Mar 9, 2010
Code:
addEventListener(MouseEvent.MOUSE_WHEEL,mouseWheel);
function mouseWheel(event:MouseEvent) {
Map.scaleX = Map.scaleX + event.delta*.01;
Map.scaleY = Map.scaleX;
}
The problem with this code is that it scales from the registration point (0,0). Due to the other transformations I'm doing to this image at various times, it isn't possible to move the registration point. The image is larger than the stage and the user is able to drag it around. I want the mouse wheel to zoom in on the place the mouse is hovering over (or at a minimum...the center of the "view" they have...aka the stage)I tried doing this:
Code:
internalPoint = new Point(Map.mouseX, Map.mouseY);
externalPoint = new Point(stage.mouseX, stage.mouseY);
var matrix:Matrix = Map.transform.matrix;
[code]....
Which, incidentally, I'm using that whole portion of code to zoom into the state they will be in when they use the mouse wheel.
View 1 Replies
Jan 24, 2011
I want to find only the first level of children. Right now I'm using e.target.name but this is also catching those targets children. How would I prevent this?
View 2 Replies
Feb 27, 2006
i saw a thread while ago .. that always position a movieclip in the middle of the stage even if the stage or window resize any1 can point me to it
View 3 Replies
Sep 14, 2009
I have a web site with an intro movie playing in the page's header.
The SWF playing the FLV with sound is in a division that is placed at a lower Z level. On top of the SWF, at a higher Z level, is a png image of my header containing an oval transparent window. This image acts as a skin sitting on top of my movie. The movie and sound play inside the oval window fine. I have other reasons for this approach as opposed to integrating the whole header image into the SWF.
The issue is I have no mouse control over the SWF because it is at a lower Z level. The mouse events are blocked by the transparent image window that sits on top.
I want to add a sound volume control to my movie. The control can sit either inside the oval area, or outside somewhere else on the page.
I would prefer to control the volume using another SWF that sits at the normal Z level where the mouse can work. Can one SWF control another?
Other alternatives might be to use Javascript, or even HTML image tags to control my SWF.
View 2 Replies
Feb 19, 2010
I have a zooming map .swf file loading in behind a navigation button interface .swf. The map.swf turns your mouse to a hand cursor so you can pan when you zoom in on it.Eveb though the map file is behind my nav file,when I roll over my nav file, the mouse is still turning to a hand cursor. Is there any way around this? The only time it turns to an actually pointer is when it rolls over the actual buttons on the nav file, so the mouse flickers back and forth between the hand and the pointer.How can I get the lower .swf to not effect the .swf on top?
View 8 Replies
Jan 12, 2006
i need to assign the possition of the mouse at the start of the level:
Code:
_root._xmouse = 424
_root._ymouse = 296.1
this doesn't work, but i have no idea how i suppose to do it anotherway
View 4 Replies