Simpelt preloader spørgsmål

Se madsen's brugerprofil
Indmeldt: 28-09-2007
Indlæg: 25
Er offline

Hey

Jeg har browset igennem sitet her og har fundet dette udemærkede script til at loade et eksternt ,jpg ind i min flash vha, moviecliploader:

on (rollOver) {
 
	var myMCL = new MovieClipLoader();
var container1_mc:MovieClip = this.createEmptyMovieClip("container1", this.getNextHighestDepth());
 
myMCL.onLoadStart = function(targetMC)
{
	var loadProgress = myMCL.getProgress(targetMC);
	trace("Bytes loaded at start="+loadProgress.bytesLoaded);
	};
myMCL.onLoadProgress = function(targetMC, loadedBytes, totalBytes)
{
 
	trace ("movie clip: " + targetMC);
	trace("Bytes loaded at progress callback=" + loadedBytes);
	trace("Bytes total at progress callback=" + totalBytes);
	trace("____________________________________");
};
myMCL.onLoadComplete = function(targetMC)
{
 
	trace (targetMC + " has finished loading.");
	var loadProgress = myMCL.getProgress(targetMC);
	trace("Bytes loaded at end=" + loadProgress.bytesLoaded);
	trace("Bytes total at end=" + loadProgress.bytesTotal);
	trace("____________________________________");
};
 
container1_mc._x = 46.8;
container1_mc._y = -51.2;
 
myMCL.loadClip("thumbs/1_small.jpg", container1_mc);
 
	_root.fadebox_mc.thumbbg_mc._visible = true;
}
 
on (rollOut) {
	container1.unloadMovie();
		_root.fadebox_mc.thumbbg_mc._visible = false;
}

Mit spørgsmål er, hvordan jeg kan lave et dynamisk teksfelt som også viser selv loadprocessen (at preloaderen tæller op) ?

Håber at nogen kan hjælpe Shocked

Kommentarer

Se jakobhs's brugerprofilcontributer
Indmeldt: 10-01-2007
Indlæg: 997
Er offline

Hejsa.. det er 100 år siden jeg har rørt AS2,

Men prøv med:

on (rollOver) {
 
	var myMCL = new MovieClipLoader();
var container1_mc:MovieClip = this.createEmptyMovieClip("container1", this.getNextHighestDepth());
 
myMCL.onLoadStart = function(targetMC)
{
	var loadProgress = myMCL.getProgress(targetMC);
	trace("Bytes loaded at start="+loadProgress.bytesLoaded);
	};
myMCL.onLoadProgress = function(targetMC, loadedBytes, totalBytes)
{
        tekstfelt.text =  Math.floor(loadedBytes/totalBytes*100)+ " %" //Her sættes tekstfeltes tekst til antal % der er loadet
	trace ("movie clip: " + targetMC);
	trace("Bytes loaded at progress callback=" + loadedBytes);
	trace("Bytes total at progress callback=" + totalBytes);
	trace("____________________________________");
};
myMCL.onLoadComplete = function(targetMC)
{
 
	trace (targetMC + " has finished loading.");
	var loadProgress = myMCL.getProgress(targetMC);
	trace("Bytes loaded at end=" + loadProgress.bytesLoaded);
	trace("Bytes total at end=" + loadProgress.bytesTotal);
	trace("____________________________________");
};
 
container1_mc._x = 46.8;
container1_mc._y = -51.2;
 
myMCL.loadClip("thumbs/1_small.jpg", container1_mc);
 
	_root.fadebox_mc.thumbbg_mc._visible = true;
}
 
on (rollOut) {
	container1.unloadMovie();
		_root.fadebox_mc.thumbbg_mc._visible = false;
}

Så skal du bare have et dynamic textfield som du giver instancenavnet 'tekstfelt'

Flash- & FlexGuy.
15 år Århus

Se madsen's brugerprofil
Indmeldt: 28-09-2007
Indlæg: 25
Er offline

Ysssir! Det spiller Wink

TAK!

Se jakobhs's brugerprofilcontributer
Indmeldt: 10-01-2007
Indlæg: 997
Er offline

Super, det lyder godt Smile

Flash- & FlexGuy.
15 år Århus