Flash CS3, AS2
I need to create a vertical volume slider for use with the FLVPlayback component. I'm trying to either customize the VolumeBar component to change it from horizontal to vertical, or create something from scratch. Either way I'm having no luck.
I know how to do this using the NetStream class by creating a sound object. Is there a way to target the sound from the FLVPlayback component so that I could use what I already have here:
Any help or ideas are greatly appreciated.PHP Code://-------------------- AUDIO CONTROLS ---------------------------
var currScrubHeight;
this.createEmptyMovieClip("vidSound",2);
vidSound.attachAudio(ns);
var vSound:Sound = new Sound(vidSound);
vSound.setVolume(75);
vol.volScrub._yscale = 75;
vol.volSlider._y = vol.volBottom._y-vol.volScrub._height;
vol.volBottom.onPress = function() {
adjustSound();
this.onMouseMove = adjustSound;
};
vol.volSlider._visible = false;
vol.volBottom.onRelease = vol.volBottom.onReleaseOutside=function () {
delete this.onMouseMove;
};
function adjustSound() {
var dist:Number = ((_root.vol._ymouse-vol.volBottom._y)/vol.volBottom._height)*100;
if (dist<=0 && dist>=-100) {
vol.volSlider._visible = true;
vol.volScrub._yscale = dist*(-1);
vol.volSlider._y = vol.volBottom._y-vol.volScrub._height;
vSound.setVolume(dist);
currScrubHeight = vol.volScrub._yscale;
}
}
Thanks!




Reply With Quote
