Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 05-08-2004, 18:49   #1 (permalink)
Trottel in As
 
Benutzerbild von Pan_Tau
 
Registriert seit: Jul 2002
Ort: Erfurt
Beiträge: 598
Probleme mit Soundpreloader

Hi Member,

Ich hab ein Problem mit einem Prealoader.

Also hab nen Soundpreloader, der auch funktioniert. Aber mein Ladebalken wird vor dem Preload einmal ganz kurz angezeigt. Das soll er aber nicht.

Folgendes Script habe ich:

Code:
onClipEvent (enterFrame) {
    if (_root.sounds.getBytesLoaded() == _root.sounds.getBytesTotal() && _root.getBytesLoaded() == _root.getBytesTotal() && _root.sounds.ok == true) {
        _root.gotoAndPlay(2);
    }
    loaded = _root.sounds.getBytesLoaded()+_root.getBytesLoaded();
    total = _root.sounds.getBytesTotal()+_root.getBytesTotal();
    _root.prozent = 100/total*loaded;
    _root.ladebalken._xscale = _root.prozent;
}
Im ersten Frame auf der HZL ist ein Stop und im 2. Frame
Code:
_root.sounds.musik.start();
stop();
Wo kann denn das Prob sein und wie kann ich es umgehen???

Mfg Taui
__________________
Seit dummheit quietscht, renn ich nur noch mit der Ölkanne rum! :-)

Geändert von Pan_Tau (05-08-2004 um 18:50 Uhr)
Pan_Tau ist offline   Mit Zitat antworten
Alt 05-08-2004, 18:55   #2 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Bisserl umständlich Dein Loader
ActionScript:
  1. _root.ladebalken._visible=false;
  2. onClipEvent (enterFrame) {
  3.     if(_root.sounds.getBytesLoaded() >5&&_root.getBytesLoaded() >5){
  4.          _root.ladebalken._visible=true;
  5.     }
  6.     if (_root.sounds.getBytesLoaded() == _root.sounds.getBytesTotal() && _root.getBytesLoaded() == _root.getBytesTotal() && _root.sounds.ok == true) {
  7.         _root.gotoAndPlay(2);
  8.     }
  9.     // <- diese klammer musste nur hierhin anstatt unten
  10.     loaded = _root.sounds.getBytesLoaded()+_root.getBytesLoaded();
  11.     total = _root.sounds.getBytesTotal()+_root.getBytesTotal();
  12.     _root.prozent = 100/total*loaded;
  13.     _root.ladebalken._xscale = _root.prozent;
  14. }
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 05-08-2004, 20:15   #3 (permalink)
Flash-holic
 
Benutzerbild von DeMoehn
 
Registriert seit: Nov 2003
Ort: Neunkirchen(Saar)
Beiträge: 988
ActionScript:
  1. stop();
  2. _root.ladebalken._visible = false;
  3. function loadSounds() {
  4.     if ([_root.sounds.getBytesLoaded()+_root.getBytesLoaded()]>5) {
  5.         _root.ladebalken._visible = true;
  6.     }
  7.     if (total>=loadedT && _root.sounds.ok == true) {
  8.         _root.gotoAndStop(2);
  9.         _root.ladebalken._visible = false;
  10.         clearInterval(_global.loadInterval);
  11.     } else {
  12.         loadedT = _root.sounds.getBytesLoaded()+_root.getBytesLoaded();
  13.         total = _root.sounds.getBytesTotal()+_root.getBytesTotal();
  14.         _root.prozent = 100/total*loaded;
  15.         _root.ladebalken._xscale = _root.prozent;
  16.     }
  17. }
  18. _global.loadInterval = setInterval(loadSounds, 25);
Ich fand das mit dem _root.getBytes und _root.sound.getBytes unnötig.
Und ein Herr Krusty sagte ma das setInterval besser is oda?¿?
__________________
Wer Großes versucht, ist bewunderswert, auch wenn er fällt.
Lucius Annaeus Seneca
(ca. 4 v. Chr - 65 n. Chr.)


DeMoehn ist offline   Mit Zitat antworten
Alt 05-08-2004, 20:27   #4 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Yupp!
Noch schöner würde des so aussehen
ActionScript:
  1. stop();
  2. _root.ladebalken._visible = false;
  3. function loadSounds() {
  4.     var l = _root.sounds.getBytesLoaded()+_root.getBytesLoaded();
  5.     var t = _root.sounds.getBytesTotal()+_root.getBytesTotal();
  6.     var p = Math.round(l/t)*100;
  7.     if (l>5) {
  8.         _root.prozent = p;//falls des "prozent" für ne prozent-anzeige war
  9.         _root.ladebalken._visible = true;
  10.         _root.ladebalken._xscale = _root.prozent;
  11.         if (p>=100 && _root.sounds.ok == true) {
  12.             _root.gotoAndStop(2);
  13.             _root.ladebalken._visible = false;
  14.             clearInterval(loadInterval);
  15.         }
  16.     }
  17. }
  18. var loadInterval = setInterval(loadSounds, 25);
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 05-08-2004, 20:33   #5 (permalink)
Flash-holic
 
Benutzerbild von DeMoehn
 
Registriert seit: Nov 2003
Ort: Neunkirchen(Saar)
Beiträge: 988
Japs.
Du hast 10.000 mehr posts als ich, ich glaub dir sieht auch echt besser aus.
PS: für was ist das _root.sounds.ok == true?¿?
__________________
Wer Großes versucht, ist bewunderswert, auch wenn er fällt.
Lucius Annaeus Seneca
(ca. 4 v. Chr - 65 n. Chr.)


DeMoehn ist offline   Mit Zitat antworten
Alt 05-08-2004, 20:48   #6 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Zitat:
Zitat von BAdBoYY
PS: für was ist das _root.sounds.ok == true?¿?
Des würd ich auch noch gerne wissen
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake 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:52 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele