Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 01-02-2004, 09:50   #1 (permalink)
Neuer User
 
Registriert seit: Feb 2004
Beiträge: 26
Probleme mit einbau eines Preloaders

Ich hab da ein Preloader hab aber leider keinen blassen schimmer von soetwas könnte mir hier einer sagen wie ich dieses teil hier einbauen soll
Code:
<script language=&quot;JavaScript1.2&quot;> 
<!-- 

startingColor = new Array() // <-- Do not modify! 
endingColor = new Array() // <-- Do not modify! 



// YOU MAY MODIFY THE FOLLOWING: 
// Fill this array with the images you wish to preload 
var yourImages = new Array (&quot;bild.gif, is nen beispiel << ! macht hier die bilder rein die geladen werden sollen z.b pbbbanner.gif, usw&quot;) 



var locationAfterPreload = &quot;main.php&quot; // The script will redirect here when the preloading finishes *successfully* 
var preloadbarWidth = 200 // The length of the preload bar. Should be greater than total amount of images you want to preload! 
var preloadbarHeight = 10 // The height of the gradient/preload bar 
var backgroundOfGradient = &quot;#333333&quot; // Default color while the preload bar is &quot;filling up&quot; 

// Color the preloadbar is starting with - enter 1st, 3rd and 5th numbers/letters of color code 
startingColor[0] = &quot;3&quot; 
startingColor[1] = &quot;3&quot; 
startingColor[2] = &quot;3&quot; 


endingColor[0] = &quot;F&quot; 
endingColor[1] = &quot;0&quot; 
endingColor[2] = &quot;0&quot; 

// FOR TROUBLESHOOTING: 
var gap = 5 // PLAY AROUND WITH THIS SETTING IF YOU GET A JAVASCRIPT ERROR!!! 2 is the minumum value!!! 


// DO NOT MODIFY ANYTHING BEYOND THIS POINT!!! 

if (!document.all) location.replace(locationAfterPreload) 
var a = 10, b = 11, c = 12, d = 13, e = 14, f=15, i, j, ones = new Array(), sixteens = new Array(), diff = new Array(); 
var convert = new Array(&quot;0&quot;,&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;,&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;,&quot;f&quot;), imgLen = yourImages.length; 
var loaded = new Array(), preImages = new Array(), currCount = 0, pending = 0, h = 0, hilite = new Array(), cover = new Array(); 
var num = Math.floor(preloadbarWidth/gap); 
for (i = 0; i < 3; i++) { 
startingColor[i] = startingColor[i].toLowerCase(); 
endingColor[i] = endingColor[i].toLowerCase(); 
startingColor[i] = eval(startingColor[i]); 
endingColor[i] = eval(endingColor[i]); 
diff[i] = (endingColor[i]-startingColor[i])/num; 
ones[i] = Math.floor(diff[i]); 
sixteens[i] = Math.round((diff[i] - ones[i])*15); 
} 
endingColor[0] = 0; 
endingColor[1] = 0; 
endingColor[2] = 0; 
i = 0, j = 0; 
while (i <= num) { 
hilite[i] = &quot;#&quot;; 
while (j < 3) { 
hilite[i] += convert[startingColor[j]]; 
hilite[i] += convert[endingColor[j]]; 
startingColor[j] += ones[j]; 
endingColor[j] += sixteens[j]; 
if (endingColor[j] > 15) { 
endingColor[j] -= 15; 
startingColor[j]++; 
} 
j++;  
} 
j = 0; 
i++; 
} 
function loadImages() { 
for (i = 0; i < imgLen; i++) { 
preImages[i] = new Image(); 
preImages[i].src = yourImages[i]; 
loaded[i] = 0; 
cover[i] = Math.floor(num/imgLen)*(i+1) 
} 
cover[cover.length-1] += num%imgLen 
checkLoad(); 
} 
function checkLoad() { 

if (pending) { changeto(); return } 

if (currCount == imgLen) { location.replace(locationAfterPreload); return } 

for (i = 0; i < imgLen; i++) { 

if (!loaded[i] && preImages[i].complete) { 

loaded[i] = 1; pending++; currCount++; 

checkLoad(); 
return; 
} 
} 
setTimeout(&quot;checkLoad()&quot;,10); 
} 
function changeto() { 
if (h+1 > cover[currCount-1]) { 
var percent = Math.round(100/imgLen)*currCount; 
if (percent > 100) while (percent != 100) percent--; 
if (currCount == imgLen && percent < 100) percent = 100; 
defaultStatus = &quot;Loaded &quot; + currCount + &quot; out of &quot; + imgLen + &quot; images [&quot; + percent + &quot;%].&quot;; 
pending--; 
checkLoad(); 
return; 
} 
eval(&quot;document.all.cell&quot; + (h+1) + &quot;.style.backgroundColor = hilite[h]&quot;);; 
h++; 
setTimeout(&quot;changeto()&quot;,1); 
} 
defaultStatus = &quot;Loaded 0 out of &quot; + imgLen + &quot; images [0%].&quot; 
// end hiding --> 
//--> 
</script> 
<script language=&quot;php&quot;> 
$string == $_SERVER['HTTP_USER_AGENT']; 
if (eregi(&quot;Linux&quot;, $string)) { 
echo &quot;Hello Linux User . Thanks of microsoft, you can't see this site in good quality. sorry&quot;; 
} 
?> 


<script language=&quot;JavaScript1.2&quot;> 
<!-- beging hiding 
document.write('<table border=&quot;1&quot; bordercolor=&quot;#333333&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;' + preloadbarWidth + '&quot;><tr height=&quot;' + preloadbarHeight + '&quot; bgcolor=&quot;' + backgroundOfGradient + '&quot;>'); 
for (i = 0; i < num; i++) { 
document.write('<td bordercolorlight=&quot;333333&quot; bordercolordark=&quot;000000&quot; width=&quot;' + gap + '&quot; id=&quot;cell' + (i+1) + '&quot;></td>'); 
} 
document.write('</tr></table>'); 
loadImages(); 
// end hiding --> 
</script>
Thx Heavenscry
Heavenscry ist offline   Mit Zitat antworten
Alt 01-02-2004, 10:07   #2 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
...und was tut das hier im FlashMX-Bereich? Das is ja irgendein JavaScript-Gebilde...

...aber trotzdem willkommen im FF natürlich!
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 01-02-2004, 10:15   #3 (permalink)
Neuer User
 
Registriert seit: Feb 2004
Beiträge: 26
Sorry aber ich wusste nicht so recht wo ich das Teil reinsetzen sollte, so hab ich Preloader gesucht und es dann in dieses forum reingesetzt.

@ Moderator
könntest du das hier für mich mal bitte dahin verschieben wo es hingehört

Thx Heavenscry
Heavenscry ist offline   Mit Zitat antworten
Alt 01-02-2004, 10:21   #4 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
Ja kommt drauf an, was du eigentlich willst... das hier is wohl eine Art JS-Preloader, der dir den content einer HTML-Seite vorlädt. Das Skript würde dann in den <head>-Bereich der HTML-Seite gehören.
Wenn du einen Flash-Preloader wolltest, is das wieder was anderes...
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 01-02-2004, 10:37   #5 (permalink)
Neuer User
 
Registriert seit: Feb 2004
Beiträge: 26
der preloader soll mir den seitenaufbau ein wenig beschleunigen
das ist richtig nur weiß ich nicht was ich da an graphiken einfügen soll
kann mir das einer für einen laien verständlich machen
Heavenscry ist offline   Mit Zitat antworten
Alt 01-02-2004, 10:40   #6 (permalink)
Neuer User
 
Registriert seit: Aug 2003
Ort: Bamberg
Beiträge: 876
er macht deine seite nicht schneller stopt dann läd er alles zeigt an wieviel prozent er geladen hat und wenns 100 % sind dann spielt er die seite ab oder zeigt sie an...
wangman ist offline   Mit Zitat antworten
Alt 01-02-2004, 10:42   #7 (permalink)
Neuer User
 
Registriert seit: Feb 2004
Beiträge: 26
und wie kriege ich dann meine seite schneller ohne das ich mich in den optionen einschränken muss
Heavenscry ist offline   Mit Zitat antworten
Alt 01-02-2004, 11:56   #8 (permalink)
Neuer User
 
Registriert seit: Feb 2004
Beiträge: 26
Einbau Preloader ne frage muss ich den vorm oder hinter dem metatag einbauen
Heavenscry ist offline   Mit Zitat antworten
Alt 01-02-2004, 12:05   #9 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
Eigentlich egal, aber meistens baut man sowas danach ein, als letztes im Head-Bereich.
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 01-02-2004, 12:14   #10 (permalink)
Neuer User
 
Registriert seit: Feb 2004
Beiträge: 26
kann mir mal einer noch ein bsp. geben was ich hier eintragen muss
Code:
var yourImages = new Array ("bild.gif, is nen beispiel << ! macht hier die bilder rein die geladen werden sollen z.b pbbbanner.gif, usw"
Heavenscry ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 02:45 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele