PDA

View Full Version : Music control slider bar as2



overlordlink
June 21st, 2010, 01:09 AM
OK I have been following a tutorial and making modifications as I went to make it work with what i needed. Now the only problew is I cant get it to play my linked song right and the slider I am using wont stopDrag lol.
here is my code.


onClipEvent(enterFrame)
{
_root.mslider.slider.onPress = function(){
_root.mslider.slider.startDrag(true, _root.mslider.bar._x, _root.mslider.bar._y, _root.mslider.bar._x + 200, _root.mslider.bar._y);
}
_root.mslider.slider.onRelease = function() {
_root.mslider.slider.stopDrag;
}
_root.playbutton.onRelease = function() {
Mysong = new Sound();
Mysong.attachSound("battletheme");
Mysong.start(0, 10);
}
_root.stop_btn.onRelease = function() {
stopAllSounds;
}
_root.mslider.slider.onMouseMove = function(){
newPoint = new Object();
newPoint.x = _root.mslider.slider._x;
newPoint.y = _root.mslider.slider._y;
_root.mslider.bar.globalToLocal(newPoint);
_root.Mysong.setVolume(-1*newpoint.x);
}
}

Can someone please help me fix it?

nathan99
June 21st, 2010, 10:49 PM
stopDrag()
stopAllSounds()

bhcho99nz
January 31st, 2011, 03:39 PM
Hi I found a solution to your problem.

I'll post the fla but you'll have to correct the actionscript. It's in AS2 and Flash CS5.

Your problem:

Correct:
_root.mslider.slider.stopDrag();

Yours:
_root.mslider.slider.stopDrag