class mp3v4{ static var mp3_obj:Sound = new Sound(); //Création de l'objet(variable) qui va ressevoir le fichier static var mp3_play:Number = 0;//musique jouer static var mp3_url:String;//musique url static var xml_nom= new Array();//nom dans le xml static var xml_mp3= new Array();//url dans le xml static var xml_img= new Array();//url dans le xml static var xml_max:Number = 0;//nombre de musique dans le mp3 static var tempo:Number = 0;//tempo des bare static var var_bare:Number = 0;//fionction de mouvement des bare static var var_p:Number = 0;//pausission de la pose static var cur_vol:Number = 0; static var on_play:Number = 0;//musique jouer static function randRange(min:Number, max:Number):Number { var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min; return randomNum; } static function anim__6930(mc:MovieClip,xml_url:String):Void{ /* <1227166940533/0> ne pas supprimer ni déplacer ce commentaire / don't supress or move this comment.*/ if(_root.flag_ini != 1){ _root.nom1_text=xml_url; _root.flag_ini = 1 ; mc.grp_vol.vol._xscale =70; mp3_obj.setVolume(70); var playlist_xml = new XML(); //recre la var de reception playlist_xml.ignoreWhite=true; //efface les retour de ligne playlist_xml.load(xml_url); //fichier xml a charger //- attente fin chargement ok ------------------- playlist_xml.onLoad = function(ok) { if (ok){ for(var i = 0; i < this.firstChild.childNodes.length; i++) { mp3v4.xml_mp3[i]= (this.firstChild.childNodes[i].attributes.mp3); mp3v4.xml_nom[i]= (this.firstChild.childNodes[i].attributes.nom); mp3v4.xml_max++; } mp3v4.xml_max--; _root.nom1_text = mp3v4.xml_nom[mp3v4.xml_max]; _root.nom2_text = mp3v4.xml_nom[0] ; _root.nom3_text = mp3v4.xml_nom[1]; mp3v4.mp3_play = 0; mp3v4.mp3_url = mp3v4.xml_mp3[mp3v4.mp3_play]; mp3v4.mp3_obj.loadSound(mp3v4.mp3_url, true); mp3v4.mp3_obj.stop(); }else{ _root.nom2_text="erreur"; }//fin if ok }; //fin fonction ok avec le ';' /* ecrire ici / write here */ for (var i=1 ;i != 9;i++){ mc.bare["bare"+i]._yscale=1; mc.bare["bare"+i+"2"]._yscale=0; mc.bare["bare"+i+"2"]._alpha=0; } } } static function anim__8630(mc:MovieClip):Void{ /* <1227169070452/0> ne pas supprimer ni déplacer ce commentaire / don't supress or move this comment.*/ var loaded:Number; loaded = Math.floor(mp3_obj.getBytesLoaded()/mp3_obj.getBytesTotal()*100); mc.bare_load._xscale = loaded; mc.bare_posi._xscale = Math.floor(mp3_obj.position/mp3_obj.duration*100);//On calcule le préchargemnt. if(var_bare == 1){ tempo++; if(tempo == 3){ tempo = 0 ; for (var i=1 ;i != 9;i++){ mc.bare["bare"+i+"2"]._alpha = 100; mc.bare["bare"+i]._yscale = randRange(15, 60); mc.bare["bare"+i+"2"]._yscale =mc.bare["bare"+i]._yscale; } } } mp3_obj.onSoundComplete = function() { if(mp3v4.on_play == mp3v4.xml_max){ mp3v4.on_play = 0; mp3v4.mp3_url = mp3v4.xml_mp3[mp3v4.on_play]; mp3v4.mp3_obj = new Sound(); mp3v4.mp3_obj.loadSound(mp3v4.mp3_url, true); mp3v4.var_p = 0; _root.nom1_text= mp3v4.xml_nom[mp3v4.xml_max]; _root.nom2_text= mp3v4.xml_nom[mp3v4.on_play]; _root.nom3_text= mp3v4.xml_nom[mp3v4.on_play+1]; mp3v4.var_bare = 1; }else{ mp3v4.on_play++; mp3v4.mp3_url = mp3v4.xml_mp3[mp3v4.on_play]; mp3v4.mp3_obj = new Sound(); mp3v4.mp3_obj.loadSound(mp3v4.mp3_url, true); mp3v4.var_p = 0; _root.nom1_text= mp3v4.xml_nom[mp3v4.on_play-1]; _root.nom2_text= mp3v4.xml_nom[mp3v4.on_play]; if(mp3v4.on_play == mp3v4.xml_max){ _root.nom3_text= mp3v4.xml_nom[0]; }else{ _root.nom3_text= mp3v4.xml_nom[mp3v4.on_play+1]; } mp3v4.var_bare = 1; } }; /* ecrire ici / write here */ } static function ecranDeBase0(mc:MovieClip):Void{ /* <1227169209536/0> ne pas supprimer ni déplacer ce commentaire / don't supress or move this comment.*/ mp3_obj.start(var_p/1000); var_bare = 1 ; /* ecrire ici / write here */ } static function ecranDeBase1(mc:MovieClip):Void{ /* <1227170113566/0> ne pas supprimer ni déplacer ce commentaire / don't supress or move this comment.*/ var_p = mp3_obj.position ;//On enregistre la position du son en millseconde. mp3_obj.stop(); var_bare = 0; } static function ecranDeBase2(mc:MovieClip):Void{ /* <1227170289207/0> ne pas supprimer ni déplacer ce commentaire / don't supress or move this comment.*/ var_bare = 0; for (var i=1 ;i != 9;i++){ mc.bare["bare"+i]._yscale=1; mc.bare["bare"+i+"2"]._yscale=0; mc.bare["bare"+i+"2"]._alpha=0; } var_p = 0; mp3_obj.stop(); } static function ecranDeBase3(mc:MovieClip):Void{ /* <1227217120561/0> ne pas supprimer ni déplacer ce commentaire / don't supress or move this comment.*/ cur_vol = mc._xmouse; mp3_obj.setVolume(Math.floor(cur_vol/75*100)); mc.vol._xscale = Math.floor(cur_vol/50*100); /* ecrire ici / write here */ } static function ecranDeBase4(mc:MovieClip):Void{ /* <1227219784769/0> ne pas supprimer ni déplacer ce commentaire / don't supress or move this comment.*/ mp3_obj.start((mc.bt_cur._xmouse*mp3_obj.duration/139)/1000); /* ecrire ici / write here */ } static function ecranDeBase5(mc:MovieClip):Void{ /* <1227220603725/0> ne pas supprimer ni déplacer ce commentaire / don't supress or move this comment.*/ if(on_play == xml_max){ on_play = 0; mp3_url = xml_mp3[on_play]; mp3_obj = new Sound(); mp3_obj.loadSound(mp3_url, true); var_p = 0; _root.nom1_text= xml_nom[xml_max]; _root.nom2_text= xml_nom[on_play]; _root.nom3_text= xml_nom[on_play+1]; var_bare = 1; }else{ on_play++; mp3_url = xml_mp3[on_play]; mp3_obj = new Sound(); mp3_obj.loadSound(mp3_url, true); var_p = 0; _root.nom1_text= xml_nom[on_play-1]; _root.nom2_text= xml_nom[on_play]; if(on_play == xml_max){ _root.nom3_text= xml_nom[0]; }else{ _root.nom3_text= xml_nom[on_play+1]; } var_bare = 1; } } static function ecranDeBase6(mc:MovieClip):Void{ /* <1227221121899/0> ne pas supprimer ni déplacer ce commentaire / don't supress or move this comment.*/ if(on_play == 0){ mp3_url = xml_mp3[xml_max]; mp3_obj = new Sound(); mp3_obj.loadSound(mp3_url, true); var_p = 0; on_play = xml_max; mc.cube.loadMovie(mp3v4.xml_img[on_play]); var_bare = 1; _root.nom1_text= xml_nom[xml_max-1]; _root.nom2_text= xml_nom[on_play]; _root.nom3_text= xml_nom[0]; }else{ on_play--; mp3_url = xml_mp3[on_play]; mc.cube.loadMovie(mp3v4.xml_img[on_play]); var_bare = 1; mp3_obj = new Sound(); mp3_obj.loadSound(mp3_url, true); var_p = 0; if(on_play == 0){ _root.nom1_text= xml_nom[xml_max]; }else{ _root.nom1_text= xml_nom[on_play-1]; } _root.nom2_text= xml_nom[on_play]; _root.nom3_text= xml_nom[on_play+1]; } } static var volumeBeforeMute = 100; static function volume(mc:MovieClip, sens:Boolean, mute:Boolean):Void{ /* <1227221121899/0> */ //fonction volume +10 var volumeOld:Number = mp3_obj.getVolume(); if(mp3_obj.getVolume() < 100 && sens){ mp3_obj.setVolume(Math.floor(mp3_obj.getVolume()+10)); } // fonction volume -10 if(mp3_obj.getVolume() > 0 && !sens){ mp3_obj.setVolume(Math.floor(mp3_obj.getVolume()-10)); } if(mute){ if(mute){ volumeBeforeMute = volumeOld; mp3_obj.setVolume(0); }else{ mp3_obj.setVolume(volumeBeforeMute); } } mc.volume.text = ""+mp3_obj.getVolume()+"%"; /* ecrire ici / write here */ } }