• 视频播放器音量控制


    //-------------------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]);
    }
    
  • 相关阅读:
    【模式识别与机器学习】——4.3离散K-L变换
    【模式识别与机器学习】——4.2特征选择
    【模式识别与机器学习】——4.1模式分类可分性的测度
    【模式识别与机器学习】——3.10决策树
    【模式识别与机器学习】——3.9势函数法:一种确定性的非线性分类方法
    【模式识别与机器学习】——3.8可训练的确定性分类器的迭代算法
    Android Appliction 使用解析
    Android Service 生命周期
    Android View 绘制刷新流程分析
    Android 设置Activity样式 透明度
  • 原文地址:https://www.cnblogs.com/leon3286/p/1901361.html
Copyright © 2020-2023  润新知