-
Volume w/ mouse position
Ok, I'm really new to flash - so I'll be grateful for any help on this.
I basically have a movie that when the mouse goes over, the movie follows. However I've restricted it to only move up and down when my mouse goes over it. I want it so that when the mouse is dragged higher, the higher the sound goes, and when it is brought down lower, it get's quieter.
This was my attempt but it f***ed up the graphics for some reason:
soundone = new Sound();
soundone.attachSound("soundone");
soundone.start()
top = beforestate2._y-50;
bottom = beforestate2._y+50;
left = beforestate2._x;
right = beforestate2._x;
center = beforestate2._x;
this.onEnterFrame = function() {
_root.volposition.text = _root.one.beforestate.soundone.getVolume();
var yMouse = _root._ymouse;
soundone.setVolume((_y-bottom)*2);
if(Math.abs(xMouse - this._x) < 2) {
this._y = yMouse;
} else {
this._y -= (this._y-yMouse) / 6;
}
}
I've been trying this for a long time with no luck. Any help is appreciated!
Thanks, andifall.
-
-
-
Quote:
Originally Posted by
koenahn
I do not open this link:confused:
-
If you don't trust the link, just google the site (www.tutvid.com) and it Will appear, meaning it's safe. I only once bumped into a not so safe site via google, and that was the pirate bay, a very well-known game-torrent site if i'm right. if you still don't believe me, just go check out tutvid's youtube channel. he has flash tutorials. the link is safe. if the domain is safe, surely why would he put a virus in a subdomain? nobody would. trusting tutvid therefore means trusting the link, and tutvid is Safe. just ask google and its little baby brother youtube.