Volledige versie bekijken : MP3 speler werkt niet
BS82
%Europe/Berlin %015 %2006, 00:22
Olla everybody!
Ik ben bezig met het ontwikkelen van een MP3 speler.
Hij doet het alleen nog niet helemaal.
Weet iemand waar de fout(en) zitten?
var trackLijst:Array = new Array();
trackLijst.push("muziek0.mp3");
trackLijst.push("muziek1.mp3");
trackLijst.push("muziek2.mp3");
trackLijst.push("muziek3.mp3");
this.createTextField("draaiend_txt",this.getNextHighestDepth(),250,0,200,20);
this.draaiend_txt.border = true;
for (var i:Number = 0; i < trackLijst.length; i++) {
// trace([i]);
var track_mc:MovieClip = this.createEmptyMovieClip("legeMovieClip_mc"+i,i+1);
// trace(track_mc);
track_mc.createTextField("track_txt",this.getNextHighestDepth(),10,i*20,200,20);
track_mc.track_txt.border = true;
track_mc.track_txt.text = trackLijst[i];
// trace(trackLijst[i]);
this.track_mc.nummer = i;
this.track_mc.onRelease = function() {
trace(this.nummer);
draaiend_txt.text = trackLijst[this.nummer];
};
};
var mp3speler:Sound = new Sound();
this.play_btn.onRelease = function() {
this.mp3speler.loadSound(trackLijst[i],false)
};
this.stop_btn.onRelease = function() {
this.mp3speler.stop();
};
PS : fla bestand uploaden lukte niet :S
renegeuze
%Europe/Berlin %020 %2006, 00:28
de variabele i zit in je for loop. Maar je probeer de i ook te gebruiken in je playbutton. Zet bij plat buttons bijvoorbeeld eens inplaats van i een 0 of 1 en kijk eens wat doe dan doet.
En een fla uploaden kan alleen als die in een zip or rar zit.
BS82
%Europe/Berlin %028 %2006, 00:40
Heb nu het volgende gedaan maar hij doet nog steeds niet echt wat:
var trackLijst:Array = new Array();
trackLijst.push("muziek0.mp3");
trackLijst.push("muziek1.mp3");
trackLijst.push("muziek2.mp3");
trackLijst.push("muziek3.mp3");
this.createTextField("draaiend_txt",this.getNextHighestDepth(),250,0,200,20);
this.draaiend_txt.border = true;
for (var i:Number = 0; i < trackLijst.length; i++) {
// trace([i]);
var track_mc:MovieClip = this.createEmptyMovieClip("legeMovieClip_mc"+i,i+1);
// trace(track_mc);
track_mc.createTextField("track_txt",this.getNextHighestDepth(),10,i*20,200,20);
track_mc.track_txt.border = true;
track_mc.track_txt.text = trackLijst[i];
// trace(trackLijst[i]);
track_mc.nummer = i;
track_mc.onRelease = function() {
trace(this.nummer);
draaiend_txt.text = trackLijst[this.nummer];
};
};
var mp3speler_sound:Sound = new Sound();
this.mp3speler_sound.spelen = i;
this.play_btn.onRelease = function() {
this.mp3speler_sound.loadSound(this.trackLijst[this.spelen],false);
};
this.stop_btn.onRelease = function() {
this.mp3speler_sound.stop();
};
renegeuze
%Europe/Berlin %041 %2006, 00:59
je had dan ook "niks" verandert:
var trackLijst:Array = new Array();
trackLijst.push("muziek0.mp3");
trackLijst.push("muziek1.mp3");
trackLijst.push("muziek2.mp3");
trackLijst.push("muziek3.mp3");
var currentTrack:Number = new Number();
this.createTextField("draaiend_txt",this.getNextHighestDepth(),250,0,200,20);
this.draaiend_txt.border = true;
for (var i:Number = 0; i < trackLijst.length; i++) {
// trace([i]);
var track_mc:MovieClip = this.createEmptyMovieClip("legeMovieClip_mc"+i,i+1);
// trace(track_mc);
track_mc.createTextField("track_txt",this.getNextHighestDepth(),10,i*20,200,20);
track_mc.track_txt.border = true;
track_mc.track_txt.text = trackLijst[i];
// trace(trackLijst[i]);
this.track_mc.nummer = i;
this.track_mc.onRelease = function() {
trace(this.nummer);
currentTrack = this.nummer;
draaiend_txt.text = trackLijst[this.nummer];
};
};
var mp3speler:Sound = new Sound();
this.play_btn.onRelease = function() {
this.mp3speler.loadSound(trackLijst[i],false)
};
this.stop_btn.onRelease = function() {
this.mp3speler.stop();
};
var mp3speler:Sound = new Sound();
this.play_btn.onRelease = function() {
this.mp3speler.loadSound(trackLijst[i],false)
};
this.stop_btn.onRelease = function() {
this.mp3speler.stop();
};
BS82
%Europe/Berlin %379 %2006, 09:06
Deed het niet helemaal juist.
Ik heb de knoppen in de for loop gezet.
Kan vanuit deze computer alleen niet kijken of het goed is.
Weet iemand of dit script nu goed is of dat er nog wat mist?
var trackLijst:Array = new Array();
trackLijst.push("muziek0.mp3");
trackLijst.push("muziek1.mp3");
trackLijst.push("muziek2.mp3");
trackLijst.push("muziek3.mp3");
this.createTextField("draaiend_txt",this.getNextHighestDepth(),250,0,200,20);
this.draaiend_txt.border = true;
for (var i:Number = 0; i < trackLijst.length; i++) {
// trace([i]);
var track_mc:MovieClip = this.createEmptyMovieClip("legeMovieClip_mc"+i,i+1);
// trace(track_mc);
track_mc.createTextField("track_txt",this.getNextHighestDepth(),10,i*20,200,20);
track_mc.track_txt.border = true;
track_mc.track_txt.text = trackLijst[i];
// trace(trackLijst[i]);
this.track_mc.nummer = i;
this.track_mc.onRelease = function() {
//trace(this.nummer);
draaiend_txt.text = trackLijst[this.nummer];
};
var mp3speler_sound:Sound = new Sound();
this.mp3speler_sound.spelen = i;
this.play_btn.onRelease = function() {
trace("Ik klik op play");
this.mp3speler_sound.loadSound(trackLijst[this.spelen],false);
};
this.stop_btn.onRelease = function() {
trace("Ik klik op stop");
this.mp3speler_sound.stop();
};
};
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.