Comment désactiver la fonction de lecture automatique ?

didou1999 - 10 août 2012 à 17:00 - Dernière réponse : pegase31 6161 Messages postés dimanche 21 décembre 2003Date d'inscriptionModérateurStatut 4 septembre 2013 Dernière intervention
- 12 août 2012 à 21:40
Bonjour,

Je cherche dans ce code la fonction qui permet de désactiver la lecture auto des fichiers mp3 d'un lecteur si vous pouviez m'indiquer la ligne en question voir le code, je galère pas possible merci de votre aide.

// Create Sound Object
var mp3_player:Sound = new Sound(this);
// Set Starting Volume  
var player_volume:Number = 75;
// Shuffle playlist mode on /off 
var shuffle = false;
// Create Playlist Array
var play_list:Array = [];
// Song position
var current_position:Number = 0;
// Starting Playing Song Number
var current_song_number:Number = 0;
// Starting Show Playlist on / off
var play_list_open:Boolean = false;
// Now playing or Stop Boolean Value
var playing_status:Boolean = false;
var drag_start:Boolean = false;
var move_stop:Boolean = false;
// Create mask for play list 
play_list_mc.setMask(mask_mc);
play_list_mc._y = play_list_mc._y-play_list_mc._height;
// Player Mute on / off 
var mute:Boolean = false;
// if shuffle mode on, goto shuffle button "on"
var goto_shuffle:String = shuffle ? "shuffle_on" : "shuffle_off";
shuffle_mc.gotoAndStop(goto_shuffle);
// Create playlist XML 
var play_list_xml:XML = new XML();
play_list_xml.ignoreWhite = true;
play_list_xml.onLoad = function(load_status:Boolean):Void  {
var nodes:Array = this.firstChild.childNodes;
play_list_length = nodes.length;
for (var i = 0; i<nodes.length; i++) {
// add all song information to playlist array 
play_list.push({url:nodes[i].attributes.url, artist:nodes[i].attributes.artist, track:nodes[i].attributes.track});
}
// goto duplicate songname on playlist function
create_play_list();
if (shuffle) {
// if shuffle mode on, goto select random song number function  
shuffle_playlist(current_song_number);
} else {
// if shuffle mode off, goto and play ordinary song
play_song(current_song_number);
}
};
// load xml file 
play_list_xml.load("xml/songs.xml");
// Define duplicate song information's text field in playlist function  
create_play_list = function () {
var song_name = this.play_list_mc.scroller_mc.mc.song_name_mc.text_mc;
// add first text field song name info 
song_name.name_txt.text = play_list[0].track+" - "+play_list[0].artist;
// first song number
song_name.number_txt.text = "01.";
// define song id 
this.play_list_mc.scroller_mc.mc.song_name_mc.color_bar_mc.id = 0;

for (i=2; i"0") {
// if shuffle mode on 
if (shuffle) {
// play random song 
shuffle_playlist(current_song_number);
} else {
// play ordinary song 
play_next();
}
clearInterval(timer);
}
}
};
// add zero to time function 
add_zero = function (num:Number):String {
return String(num).length == 1 ? "0"+num : num;
};
// Define play next song function 
play_next = function () {
// check end of playlist 
if (current_song_number<play_list.length-1) {
// next song number 
current_song_number++;
} else {
// set song number to first song
current_song_number = 0;
}
// call play song function 
play_song(current_song_number);
};
// Define random song number function 
shuffle_playlist = function (old_song_number) {
var new_song_number:Number = Math.floor(Math.random()*play_list.length);
// check old song number diffrent from new song number  
while (new_song_number == old_song_number) {
new_song_number = Math.floor(Math.random()*play_list.length);
}
current_song_number = new_song_number;
// call play song function 
play_song(new_song_number);
};
// calculate loader bar percent function
loader_status = function () {
// get loaded info
var amountLoaded:Number = mp3_player.getBytesLoaded()/mp3_player.getBytesTotal();
// set loader bar width 
loader.loadbar._width = Math.floor(amountLoaded*100);
// get total song length.
trueDuration = Math.ceil((mp3_player.duration/((mp3_player.getBytesLoaded()/mp3_player.getBytesTotal())*100))*100);
if (drag_start == false) {
// set position loader bar scrub
loader.scrub._x = (mp3_player.position/trueDuration)*100;
}
};
// create empty movie clip for loader bar scrub
this.createEmptyMovieClip("vFrame", this.getNextHighestDepth());
vFrame.onEnterFrame = loader_status;
// when press to scrub, start drag
loader.scrub.onPress = function() {
drag_start = true;
this.startDrag(false, 0, this._y, 100, this._y);
};
// when release scrub, stop dragging and calculate new song position
loader.scrub.onRelease = loader.scrub.onReleaseOutside=function () {
loader.scrub.gotoAndStop(1);
drag_start = false;
mp3_player.stop();
// get totoal time
trueDuration = Math.ceil((mp3_player.duration/((mp3_player.getBytesLoaded()/mp3_player.getBytesTotal())*100))*100);
// calculate new song position
current_position = Math.floor(((loader.scrub._x/100)*trueDuration)/1000);
// start song from new position
mp3_player.start(current_position, 1);
this.stopDrag();
};
loader.scrub.onRollOver = function() {
loader.scrub.gotoAndStop(2);
};
loader.scrub.onRollOut = function() {
loader.scrub.gotoAndStop(1);
};
// when over the show playlist button 
show_playlist_mc.onRollOver = function() {
if (play_list_open == false) {
show_playlist_mc.gotoAndStop("open_over");
} else {
show_playlist_mc.gotoAndStop("close_over");
}
};
// when rollout the show playlist button 
show_playlist_mc.onRollOut = function() {
if (play_list_open == false) {
show_playlist_mc.gotoAndStop("open");
} else {
show_playlist_mc.gotoAndStop("close");
}
};
// when pressed the show playlist button 
show_playlist_mc.onRelease = function() {
if (move_stop == false) {
if (play_list_open == false) {
// playlist movie clip move distance (goto down) 
var distance_y = 155;
show_playlist_mc.gotoAndStop("close_over");
} else {
// playlist movie clip move distance (goto up) 
var distance_y = -155;
show_playlist_mc.gotoAndStop("open_over");
}
// set reverse boolean value  
play_list_open = !play_list_open;
// call playlist move function..(0.3 = move speed)  
content_move(play_list_mc, distance_y, 0.3);
}
};
// Define Playlist Box (content) main scroller function. (target MC, scroll distance, scroll speed) 
function content_move(target:MovieClip, scroll_distance_y:Number, speed:Number) {
move_stop = true;
current_y = target._y;
target.onEnterFrame = function() {
if (scroll_distance_y<0) {
current_scroll_distance = Math.floor(((scroll_distance_y+current_y)-target._y)*speed);
} else {
current_scroll_distance = Math.ceil(((scroll_distance_y+current_y)-target._y)*speed);
}
if (target._y == scroll_distance_y+current_y) {
move_stop = false;
delete target.onEnterFrame;
}
target._y += current_scroll_distance;
};
}
// when pressed the mute button 
mute_mc.onRelease = function() {
if (mute == false) {
old_volume = player_volume;
player_volume = 0;
set_volume(player_volume);
mute = true;
mute_mc.gotoAndStop("mute_on_over");
} else {
player_volume = old_volume;
set_volume(player_volume);
mute = false;
mute_mc.gotoAndStop("mute_off_over");
}
};
mute_mc.onRollOver = function() {
if (mute == false) {
mute_mc.gotoAndStop("mute_off_over");
} else {
mute_mc.gotoAndStop("mute_on_over");
}
};
mute_mc.onRollOut = function() {
if (mute == false) {
mute_mc.gotoAndStop("mute_off");
} else {
mute_mc.gotoAndStop("mute_on");
}
};
set_volume = function (player_volume) {
mp3_player.setVolume(player_volume);
volume_control_mc.volume_bar_mc._width = volume_control_mc.slider_mc._x=(player_volume/100)*100;
};
shuffle_mc.onRollOver = function() {
var goto_shuffle:String = shuffle ? "shuffle_on_over" : "shuffle_off_over";
shuffle_mc.gotoAndStop(goto_shuffle);
};
shuffle_mc.onRollOut = function() {
var goto_shuffle:String = shuffle ? "shuffle_on" : "shuffle_off";
shuffle_mc.gotoAndStop(goto_shuffle);
};
shuffle_mc.onRelease = function() {
shuffle = !shuffle;
var goto_shuffle:String = shuffle ? "shuffle_on" : "shuffle_off";
shuffle_mc.gotoAndStop(goto_shuffle);
};
Afficher la suite 

1 réponse

Répondre au sujet
pegase31 6161 Messages postés dimanche 21 décembre 2003Date d'inscriptionModérateurStatut 4 septembre 2013 Dernière intervention - 12 août 2012 à 21:40
0
Utile
Bonsoir,

Le mieux serait de demander à la personne qui a créé le code de t'expliquer comment faire.

Peg'
Admin Codes-Sources
Commenter la réponse de pegase31

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.