资源描述:
《纯as制作简单的mp3播放器》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、纯AS制作简单的MP3播放器我终于用纯AS做了个简单MP3播放器,请大家指点!效果见我的网页中v/春暖花开.mp3",true);my_sound.start();//循环播放my_sound.onSoundplete=function(){my_sound.start();};//创建音量底线this.createEmptyMovieClip("xing_mc",1);c){beginFill(0x009900);moveTo(46,11);lineTo(100,11);lineTo(100,12);lineTo(46,12);lineTo(46,
2、11);endFill();}//创建背景方框this.createEmptyMovieClip("fangkang_mc",2);c){lineStyle(1,0x008800);moveTo(0,0);lineTo(260,0);lineTo(260,14);lineTo(0,14);lineTo(0,0);}//创建音量滑块并控制音量this.createEmptyMovieClip("drag_mc",3);c){beginFill(0x008800);moveTo(46,3);lineTo(50,3);lineTo(50,12);lineT
3、o(46,12);lineTo(46,3);endFill();}left=drag_mc._x;right=left+50;top=drag_mc._y;bottom=drag_mc._y;drag_mc._x=my_sound.getVolume();drag_mc._x=50;drag_mc.onPress=function(){this.startDrag(false,left,top,right,bottom);};drag_mc.onRelease=drag_mc.onReleaseOutside=function(){stopDrag(
4、);my_sound.setVolume((this._x)*2);};//按钮的可见性pause_mc._visible=1;play_mc._visible=0;//创建播放按钮this.createEmptyMovieClip("play_mc",4);c){beginFill(0x008800);moveTo(5,3);lineTo(14,7.5);lineTo(5,12);lineTo(5,3);endFill();}play_mc.onRelease=function(){my_sound.start(time);this._visibl
5、e=0;pause_mc._visible=1;};//创建停止按钮this.createEmptyMovieClip("stop_mc",5);c){beginFill(0x008800);moveTo(25,3);lineTo(34,3);lineTo(34,12);lineTo(25,12);lineTo(25,3);endFill();}stop_mc.onRelease=function(){my_sound.stop();pause_mc._visible=0;play_mc._visible=1;time=0};//创建暂停按钮this
6、.createEmptyMovieClip("pause_mc",6);c){beginFill(0x008800);moveTo(5,3);lineTo(14,3);lineTo(14,12);lineTo(5,12);lineTo(5,3);endFill();12下一页[感谢阅读这篇文章,..,]beginFill(0xFFFFFF);moveTo(8,3);lineTo(11,3);lineTo(11,12);lineTo(8,12);lineTo(8,3);endFill();}pause_mc.onRelease=function(){t
7、his._visible=0;play_mc._visible=1;my_sound.stop();time=my_sound.position/1000;};//创建进度显示文本this.createTextField("shijian_txt",7,112,-2,100,20);shijian_txt.textColor=0x009900;shijian_txt.autoSize=true;onEnterFrame=function(){vartotalseconds:Number=my_sound.duration/1000;varminute
8、s:Number=Math.floor(totalseconds/60);varseconds=Math.f