Bonjour a tous,
j'ai un player en flv que je me suis procuré sur ce site mais malheuresement je ne trouve pas la manière pour que le flv se lance automatiquement (sans que l'on ai clické sur le bouton play)
Je vous remercie du fond du couer car j'en ai vraiment besoin pour une association merci!
Voici le code actionscript principal:
//Import du fichier XML
Chemin = new Array();
Titre = new Array();
no_1 = 0;
nb_art = 0;
NB = this;
Pfd = 50;
var myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(flag) {
if (flag) {
i = 0;
x = myXML.firstChild;
y = 10;
while (x.childNodes[i] != undefined && i<20) {
Chemin[i] = x.childNodes[i].childNodes[0].attributes.value;
Titre[i] = x.childNodes[i].childNodes[1].attributes.value;
attachMovie("MenuVid","menu_"+i,i,{_x:440, _y:y, t_vid:Titre[i], c_vid:Chemin[i]});
equalizer._visible=0;
y+=20;
i++;
}
nb_art = i;
}
play();
};
myXML.load("sawt.xml");
stop();
//Declaration des variables pour NetStream
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream(netConn);
ma_video.attachVideo(netStream);
netStream.setBufferTime(5);
dmcChargement = setInterval( chargement, 30 );
dmcPosition = setInterval( position, 100 )
txt = "";
//display = "";
equalizer._visible=0;
netStream.onStatus = function(info) {
if (info.code == "NetStream.Play.StreamNotFound") {
txt = "Clip introuvable.";
charg_conteneur._visible=0;
}
};
//Récupération de la durée totale du FLV
//Attention FLV doit être encodé avec Flash
//netStream.onMetaData = function(obj) {
//for (var x in obj){
//trace("FLV "+x+" is "+obj[x]);
//}
//}
function chargement(){
//Mise en pourcentage
var pourcentage = Math.round(netStream.bytesLoaded*100/netStream.bytesTotal);
//trace(netStream.bytesTotal)
//Modification de la barre de chargement
barre_conteneur.barre._xscale = pourcentage;
//Suppression de la variable interval quand tout est chargé
if(pourcentage==100){
clearInterval(dmcChargement);
barre_conteneur._visible=0;
charg_conteneur._visible=0;
}
}
//Gestion Volume Sonore
piste_pan.attachAudio(netStream);
var DmcSound = new Sound("piste_pan");
// Equalizer en actionscript
equalizer.onEnterFrame = function() {
i++;
this.createEmptyMovieClip("graph"+i,i);
with(this["graph"+i]) {
_x = 0;
_y = 0;
beginFill(0x666666, 50);
moveTo(0,0);
for (j=0; j< 7; j++) {
z = random(12)+8;
lineTo(j*6,-1);
lineTo(j*6,-z);
lineTo(j*6+4,-z);
lineTo(j*6+4,-1);
lineTo(j*6,-1);}
lineTo(j*6,0);
lineTo(0,0);
endFill(); }
i >= 7 ? i=0: null; };
Ce fichier a été téléchargé depuis
http://www.flashkod.com/code.aspx?ID=38269
Merci