视频播放器音量控制
//-------------------SCRUBBER + BUTTONS CONTROL--------------------// control.scruber_mc.scruber_button_mc.onPress = function(){ var tween = new Tween(control.pos_info_mc, "_alpha", Regular.easeOut, control.pos_info_mc._alpha, 100, 0.5, true); clearInterval(video_update_int); scruber_int = setInterval(video_scruber_fc, 30); } control.scruber_mc.scruber_button_mc.onRelease = control.scruber_mc.scruber_button_mc.onReleaseOutside = function(){ var tween = new Tween(control.pos_info_mc, "_alpha", Regular.easeOut, control.pos_info_mc._alpha, 50, 0.5, true); clearInterval(scruber_int); scruber_int = setInterval(videoUpdate, 30); } function video_scruber_fc(){ var dist:Number = (control.scruber_mc._xmouse + control.scruber_mc.scruber_button_mc._x) / control.scruber_mc.scruber_button_mc._width; ns.seek(Math.round(dist * ns.duration)); control.scruber_mc.scruber_button_sus_mc._xscale = (ns.time / ns.duration) * 100; info_text_playlist_mc.time_txt.text = time_fc(); updateAfterEvent(); } //----------------- SOUND CONTROL -------------------------// this.createEmptyMovieClip("my_sound_mc", this.getNextHighestDepth()); my_sound_mc.attachAudio(ns); var my_sound_s = new Sound(my_sound_mc); control.vol_mc.vol_button_mc._xscale = 70; my_sound_s.setVolume(70); control.vol_mc.vol_jos_mc.onPress = function(){ var tween = new Tween(control.vol_info_mc, "_alpha", Regular.easeOut, control.vol_info_mc._alpha, 100, 0.5, true); set_volume_int = setInterval(set_volume_fc, 30); } control.vol_mc.vol_jos_mc.onRelease = control.vol_mc.vol_jos_mc.onReleaseOutside = function(){ var tween = new Tween(control.vol_info_mc, "_alpha", Regular.easeOut, control.vol_info_mc._alpha, 50, 0.5, true); clearInterval(set_volume_int); } function set_volume_fc(){ var percent = (control.vol_mc._xmouse + control.vol_mc.vol_jos_mc._x) / control.vol_mc.vol_jos_mc._width; var percentTotal = Math.round(percent * 100); if (percentTotal >= 0 && percentTotal <= 100){ control.vol_mc.vol_button_mc._xscale = percent * 100; my_sound_s.setVolume(percentTotal); } //trace(percentTotal); } //-----------------FUNCTION TO CHANGE MOVIE WHEN IS FINISHED-----------------------// function current_movie(){ ns.close() info_text_playlist_mc.curetly_playng_nr.text = (curent_movie_play + 1) + " / " + totalEntries play_movie(String(movie_path_ar[curent_movie_play])); info_text_playlist_mc.curetly_playng_txt.text = String(movie_artist_ar[curent_movie_play] + " - " + movie_name_ar[curent_movie_play]); }