// Preloader sichtbar
_root.preloader._visible = 1;
// Objektinitialisierung
_root.DB_QUERY = new LoadVars ();
// Pfad und Parameterdefinition in einer
// Variable mit Anti-Cache á la Kannengiesser
_root.wortpfad = "inhalt.php?Ortschaft=" + _root.Ort + "&Branche=" + _root.Branche + "&sprache=" + _root.Sprache + "&datum=" + new Date ().getTime ();
// Ladeanweisung mit Quelle, Parametern,
// Ziel und Methode, bei einer txt reicht Load
// statt sendAndLoad
_root.DB_QUERY.sendAndLoad (_root.wortpfad, _root.DB_QUERY, "POST");
// Was passiert wenn alles geladen ist? Die Anweisungen NACH
// diesem Block werden ZUERST ausgeführt ! In diesem (simplen)
// Falle verteilt AS die geladenen Variablen auf _root. gelagerte html textfelder.
// Man siehe: unser neu definiertes Loadvars Objekt ist ansprechbar wie ein
// Movieclip, hättest du aber oben in der sendAndLoad _root als Ziel
// angegegeben. müsstest du die vars auch da abholen, der Vorteil liegt in der
// sauberen Programmierung: führst du einen erneuten Load aus, überschreiben
// sich die Variablen, und mit einem einfachen delete kannst du haufenweise
// Variablen aus dem Speicher kicken...>Performancetechnisch
_root.DB_QUERY.onLoad = function () {
_root.Text1.htmlText = _root.DB_QUERY.n1;
_root.Text2.htmlText = _root.DB_QUERY.n2;
_root.Text3.htmlText = _root.DB_QUERY.n3;
_root.Text4.htmlText = _root.DB_QUERY.n4;
_root.Text5.htmlText = _root.DB_QUERY.n5;
_root.Text6.htmlText = _root.DB_QUERY.n6;
_root.Text7.htmlText = _root.DB_QUERY.n7;
_root.Text8.htmlText = _root.DB_QUERY.n8;
_root.Text9.htmlText = _root.DB_QUERY.n9;
_root.Text10.htmlText = _root.DB_QUERY.n10;
_root.Text11.htmlText = _root.DB_QUERY.n11;
_root.Text12.htmlText = _root.DB_QUERY.n12;
_root.Text13.htmlText = _root.DB_QUERY.n13;
_root.Text14.htmlText = _root.DB_QUERY.n14;
_root.Text15.htmlText = _root.DB_QUERY.n15;
_root.Text16.htmlText = _root.DB_QUERY.n16;
_root.Text17.htmlText = _root.DB_QUERY.n17;
_root.Text18.htmlText = _root.DB_QUERY.n18;
_root.Text19.htmlText = _root.DB_QUERY.n19;
_root.Text20.htmlText = _root.DB_QUERY.n20;
// hier der preloader, der (SKYLAB inspiriert) das Objekt das wir neu geschaffen
// haben abfragt, und einen Standard Thermometer Preloader mit den
// entsprechenden Daten füttert, durch unser onLoad Event weiter oben lauft der
// preloader durch, und wenn dieser die 100 geschafft hat, werden die vars auch
// verteilt, halt fast schon objektorientiert.....
var controller = this.createEmptyMovieClip ("promotor2", 1);
controller.onEnterFrame = function () {
var geladen = _root.DB_QUERY.getBytesLoaded ();
var total = _root.DB_QUERY.getBytesTotal ();
if (geladen && total) {
var ready = Math.round (geladen * 100 / total);
}
else {
var ready = 0;
}
_root.preloader.prozentanzeige = "Lade..." + ready + "%";
_root.preloader.kbanzeige = Math.round (ready / 1024) + " kB von " + Math.round (total / 1024) + " kB";
_root.preloader.ladebalken._xscale = ready;
if (ready == 100) {
delete this.onEnterFrame;
}
};
grüsse B
};