Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 07-09-2005, 19:33   #1 (permalink)
Neuer User
 
Registriert seit: Jan 2003
Beiträge: 102
Unhappy Soundsteuerung hakt

Hi,

ich habe folgendes Script ins erste Schlüsselbild eingebaut:

ActionScript:
  1. stop();
  2. stopAllSounds();
  3. zustand = "aus";
  4.  
  5. //Play-Button
  6. _root.btn_play.onRelease = function() {
  7.          if (zustand == "aus") {
  8.          mySound = new Sound(this);
  9.          mySound.attachSound("take1");
  10.          mySound.start(0, 1);
  11.         gotoAndPlay("schritt1");
  12.         zustand = "an";
  13.      }
  14. }
  15.  
  16.  
  17. //Stop-Button
  18. _root.btn_stop.onRelease = function() {
  19.     if (zustand == "an") {
  20.         mySound.stop();
  21.         stop();
  22.         zustand = "aus";
  23.     }
  24. }
  25.  
  26. //Pause-Button
  27. _root.btn_pause.onRelease = function() {
  28.     if (zustand == "an") {
  29.         mySound.stop();
  30.         aktPosition = (mySound.position/1000);
  31.         stop();
  32.         zustand = "aus";
  33.     }
  34.     else {
  35.         mySound.start(aktPosition, 1);
  36.         zustand = "an";
  37.     }
  38. }
  39.  
  40.  
  41.  
  42. //Forward-Button
  43. _root.btn_forward.onRelease = function() {
  44.         stopAllSounds();
  45.         gotoAndPlay("schritt2");
  46. }
  47.  
  48. //Rewind-Button
  49. _root.btn_rewind.onRelease = function() {
  50.         stopAllSounds();
  51.         gotoAndPlay("schritt1");
  52. }

Probleme bereitet mir Zeile 11:
ActionScript:
  1. gotoAndPlay("schritt1");

Wenn ich auf stop drücke, dann wird das soundfile erst beim zweiten klick auf play wieder gestartet; beim ersten Klick auf play passiert gar nix.
Wenn ich die Zeile weg lasse, dann funktioniert der Wechsel von stop nach play reibungslos!
Hat jemand ne Idee?
vindiesel ist offline   Mit Zitat antworten
Alt 07-09-2005, 21:48   #2 (permalink)
agedoubleju
Gast
 
Beiträge: n/a
Zitat:
Hat jemand ne Idee?
Dazu müsstest du erst einmal verraten, was in den beiden anderen Frames passiert...

Außerdem würde es helfen, wenn du deine Variablenzustände im Testmodus über trace-Befehle ausgibst, besonders die Variable "zustand".
  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:20 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele