Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 07-02-2005, 20:24   #1 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
preloader mit externen sounddateien

sobald ich die mp3's inkludieren will in den preloader, funktioniert der preloader(die animation) nicht mehr;habe mal 2 sounds rausgenommen, bringt auch nix;
ActionScript:
  1. stop();
  2. bgSoundA = new Sound();
  3. bgSoundA.loadSound("heart.mp3", false);
  4. bgSoundB = new Sound();
  5. bgSoundB.loadSound("porcelain.mp3", false);
  6. bgSoundC = new Sound();
  7. bgSoundC.loadSound("inside.mp3", false);
  8. Movieclip.prototype.preload = function() {
  9.     var totalSoundA= bgSoundA.getBytesTotal();
  10.     /*var totalSoundB = bgSoundB.getBytesTotal();
  11.     var totalSoundC = bgSoundC.getBytesTotal();*/
  12.     var totalBytes = _root.getBytesTotal();
  13.     // loadedBytes;
  14.     gesamtBytes = totalBytes+totalSoundA;//+totalSoundB+totalSoundC;
  15.     var prozent = 0;
  16.     this.T_prozent.autoSize = "center";
  17.     this.onEnterFrame = function() {
  18.         loadedSoundA = bgSoundA.getBytesLoaded();
  19.         /*loadedSoundB = bgSoundB.getBytesLoaded();
  20.         loadedSoundC = bgSoundC.getBytesLoaded();*/
  21.         loadedBytes = _root.getBytesLoaded();
  22.         loaded = loadedBytes+loadedSoundA;//+loadedSoundB+loadedSoundC;
  23.         prozent = Math.round(loaded*100/gesamtBytes);
  24.         if (prozent<100) {
  25.             this.T_prozent.text = "loading intro..."+prozent+"% loaded";
  26.             //this.balken._xscale = prozent;//deaktiviert
  27.             this.balken._rotation += 50;
  28.             this.balken._alpha = ((prozent/prozent)*100)-prozent;
  29.             this.balken._xscale = ((prozent/prozent)*100)-prozent;
  30.                     } else {
  31.             this.T_prozent.text = "complete loaded...100 %";
  32.             this.balken._rotation = 180;
  33.             var iv = setInterval(function () {
  34.                 _root.nextFrame();
  35.                 clearInterval(iv);
  36.             }, 100);
  37.             delete this.onEnterFrame;
  38.         }
  39.     };
  40. };
  41. MC_preloader.preload();
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 07-02-2005, 21:48   #2 (permalink)
!diot
 
Benutzerbild von Fuery3302
 
Registriert seit: Aug 2003
Ort: PunkRockCity-Linz
Beiträge: 95
Question

also meiner meinung steht da zuviel drinnen. hab mir deinen code grade durchgelesen und hab mich bei einigen so gefragt.

1. wieso rechnest du _root.getBytesTotal und _root.getBytesLoaded mit, wenn du nur sounds lädst?
Zitat:
Zitat von andretti
ActionScript:
  1. var totalSoundA= bgSoundA.getBytesTotal();
  2. /*var totalSoundB = bgSoundB.getBytesTotal();
  3. var totalSoundC = bgSoundC.getBytesTotal();*/
  4. var totalBytes = _root.getBytesTotal();
  5. // loadedBytes;
  6. gesamtBytes = totalBytes+totalSoundA;//+totalSoundB+totalSoundC;
  7.    
  8. loadedSoundA = bgSoundA.getBytesLoaded();
  9. /*loadedSoundB = bgSoundB.getBytesLoaded();
  10. loadedSoundC = bgSoundC.getBytesLoaded();*/
  11. loadedBytes = _root.getBytesLoaded();
  12. loaded = loadedBytes+loadedSoundA;
  13. //+loadedSoundB+loadedSoundC;
  14.  
2. was willst du mit dieser rechnung erreichen
((prozent/prozent)*100)-prozent
=
(1*100) - prozent
=
100- prozent

oder kommt da noch ein anderer faktor hinzu?
Zitat:
Zitat von andretti
ActionScript:
  1. this.balken._alpha = ((prozent/prozent)*100)-prozent;
  2. this.balken._xscale = ((prozent/prozent)*100)-prozent;
3. wieso nen Interval aufrufen und ihn gleich wieder löschen. da kannst du ja gleich
ActionScript:
  1. _root.nextFrame();
schreiben. oder lieg ich da auch falsch.

Zitat:
Zitat von andretti
ActionScript:
  1. var iv = setInterval(function () {
  2. _root.nextFrame();
  3. clearInterval(iv);
  4. }, 100);
lg nach Wien, Füry
__________________
Incubus rocks
Fuery3302 ist offline   Mit Zitat antworten
Alt 07-02-2005, 22:06   #3 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
1.: ich lade natürlich nicht nur nicht nur sounds, sondern ja auch den flashfilm....aber den muss i ja net so laden wie soundvariablen
2.: der MC_preloader.balken dreht sich und wird kongruent mit prozent kleiner und durchsichtiger;
3.: das setInterval bewirkt, dass nicht sofort zu nextframe gesprungen wird, sondern nach gewisser zeit eben, dennoch muss ich ja interval clearen...100 sollte 500 sein
4.: warum kannst du mir nich bei meinem problem helfen?

ebenfalls liebe grüße nach linz( tolles sportler-outfit.....)
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 08-02-2005, 07:01   #4 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
morgäääähbn!

bitte, leutz......da is sicher nur ein kleiner haken, den ich hirni wieder net schnall'

edit:

was ich bis jetzt rausgefunden habe:
wenn ich nur _root im preloader einbaue, dan funktioniert alles, wenn ich per trace prozent auslesen lasse, dann gibt er brav1,2,3,4,5,6......an;
die mp3 hat 2,5 mb...eventuell liegt es daran?aber dann ist ja zewck eines preloaders sinnlos....
sobald ich aber nun die mp3 so, wie ich es unten im script mache, integriere, dann frisst der preloader die prozent nimmer, bedeutet, dass dann der trace auch nicht erscheint.......
ActionScript:
  1. stop();
  2. heart = new Sound();
  3. heart.loadSound("heart.mp3", false);
  4. Movieclip.prototype.preload = function() {
  5.     this.T_prozent.autoSize = "center";
  6.     var totalHeart = heart.getBytesTotal();
  7.     var totalBytes = _root.getBytesTotal();// loadedBytes;
  8.     gesamt = totalBytes+totalHeart;
  9.     var prozent = 0;
  10.     this.onEnterFrame = function() {
  11.         var loadedHeart = heart.getBytesLoaded();
  12.         var loadedBytes = _root.getBytesLoaded();
  13.         loaded =loadedBytes+ loadedHeart;
  14.         prozent = Math.round(loaded*100/gesamt);
  15.         if (prozent<100) {
  16.             this.T_prozent.text = "loading mysite!..."+prozent+"% loaded";
  17.             this.balken._rotation += 50;
  18.             this.balken._alpha = ((prozent/prozent)*100)-prozent;
  19.             this.balken._xscale = ((prozent/prozent)*100)-prozent;
  20.             trace(prozent);
  21.         } else {
  22.             this.T_prozent.text = "welcome !";
  23.             //this.balken._rotation = 180;
  24.             var iv = setInterval(function () {
  25.                 _root.nextFrame();
  26.                 clearInterval(iv);
  27.             }, 500);
  28.             delete this.onEnterFrame;
  29.         }
  30.     };
  31. };
  32. MC_preloader.preload();
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary

Geändert von andretti (08-02-2005 um 08:06 Uhr)
andretti ist offline   Mit Zitat antworten
Alt 08-02-2005, 14:03   #5 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
bittääääääääääää
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 08-02-2005, 21:50   #6 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 09-02-2005, 00:18   #7 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Aloa!
In einem Loader lassen sich keine zwei oder mehrere werte gleichzeitig abfragen!
Des mußt hintereinander machen (erst _root dann Mucke)!!
__________________
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 09-02-2005, 22:49   #8 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
@ RustyCake:

kann man so nicht sagen......

mein preloader funktioniert, sobald ich
ActionScript:
  1. heart.loadSound("heart.mp3", false);

mit
ActionScript:
  1. heart.loadSound("heart.mp3", true); //das true macht es aus....!?!?
  2.  

ersetze...bin gerade draufgekommen.....lustig, oder?
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 10-02-2005, 06:35   #9 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
also ist es so, dass Flash sehr wohl mehrere komponenten auf einmal(halt in einer variable zusammengefasst) vorladen kann, aber sobald der streaming-wert beim loadSound auf "false" gesetzt wird, schließt flash das vorladen für diese externe sounddatei datei aus.....?
wenn ich nun den Wert auf "true" setze und in der nächsten Zeile den sound per
mySound.stop(); anhalte,
erreiche ich anscheinend den selben Effekt.....
es dürfte hier im Forum niemanden geben, der mir wirklich konkret(mit einem Beispiel vielleicht) sagen könnte, wie das denn tatsächlich ist;
ich habe einen dicken Wälzer(Flash MX 2003/Actionscript-Kompendium)- über preloader stehen lächerliche 2 Seiten, und da handelt es sich tatsächlich um den 0815- preloader, keine weiteren Ausführungen..auch schade;
also möchte ich das Thema noch nicht ganz vom Tisch kehren, vielleicht stolpert ja doch noch jemand drüber und kann dieses "Phänomen" erklären;
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary

Geändert von andretti (10-02-2005 um 11:42 Uhr)
andretti ist offline   Mit Zitat antworten
Alt 13-12-2006, 15:41   #10 (permalink)
Neuer User
 
Registriert seit: Jul 2006
Beiträge: 54
Hallo

Habe Dein Script mit der TRUE anstatt FALSE Einstellung probiert - aber bei mir läuft das Intro nicht ab, der Sound schon. Kann Dir zwar nicht bei Deinem Problem helfen aber Dein Script gut gebrauchen, da ich nen Preloader brauche, bei dem man den Sound einfach ersetzen kann.

<code>
stop ();
intro = new Sound();
intro.loadSound("intro.mp3", true);
Movieclip.prototype.preload = function() {
this.T_prozent.autoSize = "center";
var totalIntro = intro.getBytesTotal();
var totalBytes = _root.getBytesTotal();// loadedBytes;
gesamt = totalBytes+totalHeart;
var prozent = 0;
this.onEnterFrame = function() {
var loadedIntro = intro.getBytesLoaded();
var loadedBytes = _root.getBytesLoaded();
loaded =loadedBytes+ loadedHeart;
prozent = Math.round(loaded*100/gesamt);
if (prozent<100) {
this.T_prozent.text = "loading hoerspiel-hagen!..."+prozent+"% loaded";
this.balken._rotation += 50;
this.balken._alpha = ((prozent/prozent)*100)-prozent;
this.balken._xscale = ((prozent/prozent)*100)-prozent;
trace(prozent);
} else {
this.T_prozent.text = "welcome !";
var iv = setInterval(function () {
_root.gotoAndPlay("2");
clearInterval(iv);
}, 500);
delete this.onEnterFrame;
}
};
};
MC_preloader.preload();</code>

Ich habe das Script ins leere, erste Frame gepackt und nach MC_preloader als Movieclip incl. gleichem Linkage (Instanznamen?) benannt. Wenn ich stop(); rausnehme funktionierts, aber dann hebe ich doch das preloaden auf, oder? Wäre Dir für Hilfe dankbar.

LG Dominik
dombre ist offline   Mit Zitat antworten
Alt 13-12-2006, 15:43   #11 (permalink)
Neuer User
 
Registriert seit: Jul 2006
Beiträge: 54
Uaaahhh

Sorry bin zu blöd zum zitieren eines Codes.
dombre ist offline   Mit Zitat antworten
Alt 13-12-2006, 15:44   #12 (permalink)
Neuer User
 
Registriert seit: Jul 2006
Beiträge: 54
jaja, die eckigen Klammern nehmen...
dombre 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 03:43 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele