Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 29-02-2004, 22:38   #1 (permalink)
*~*~*~*~*~*~*~*
 
Registriert seit: Feb 2002
Ort: Perth, WA
Beiträge: 651
soundfade

hi.. ich seh wahrscheinlcih den wald vor lauter baeumen nihct...
ich habe verschiedene sounds, die ich gegeneinander ausfaden möchte( immer nur zwei gleichzeitig), der wechsel klappt soweit, aber die volume "zickt" rum bzw bleibt stehn ... was ueberschreibt sich da?
oder blockiert sich?

danke.. *verweifel


ActionScript:
  1. _global.currentSound=sound1; //mc
  2. var nextOne = null;
  3.  
  4. MovieClip.prototype.startSound=function()
  5. {
  6.     trace("startsound : " +_global.currentSound);
  7.     //damits nicht mehrfahc aufegrufen wird
  8.     if(!this.playing)
  9.     {
  10.         _global.currentSound=this.s;
  11.         _global.currentSound.start(0,1);
  12.  
  13.         _global.currentSound.onSoundComplete=function()
  14.         {
  15.             _global.currentSound.start();
  16.         }
  17.         this.playing=1;
  18.     }
  19.  
  20. }
  21. MovieClip.prototype.stopSound=function()
  22. {
  23.     trace("stopsound : "  + _global.currentSound)
  24.     if(this.playing)
  25.     {
  26.         this.s.stop();
  27.         this.playing=0;
  28.     }
  29. }
  30.  
  31.  
  32. function lowerVolume()
  33. {
  34.     this.vol--;
  35.      _global.currentSound.setVolume(this.vol);
  36.  
  37.      if(this.vol<=0)
  38.      {
  39.           _global.currentSound.stopSound();
  40.           _global.currentSound=nextOne;
  41.           _global.currentSound.startSound();
  42.           this.onEnterFrame = raiseVolume;
  43.      }
  44. }
  45.  
  46. function raiseVolume()
  47. {
  48.     trace("volume: " + this.vol);
  49.  this.vol=_global.currentSound.getVolume();
  50.  this.vol++;
  51.  _global.currentSound.setVolume(this.vol);
  52.  
  53.  if(this.vol==100)
  54.   delete this.onEnterFrame;
  55. }
  56.  
  57.  
  58. function setSound(nextSound)
  59. {
  60.     trace("setSound : " + nextSound);
  61.      nextOne = nextSound;
  62.      this.vol=_global.currentSound.getVolume();
  63.      this.onEnterFrame=lowerVolume;
  64. }
  65.  
  66. //aufgerufen wirds dannso:
  67.  setSound(sound2)
;
sina 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 07:16 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele