Thursday, July 29th 2010, 1:27pm UTC+2

You are not logged in.

  • Login
  • Register

[Sound in Flash] Sound OOP

undefined

Super Moderator

Posts: 4,248

Location: Germany

1

Sunday, April 27th 2003, 4:50pm

Sound OOP

Mal ein kleines Sound OOP für den selbst gebauten MP3 Player

ActionScript-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
soundfile = new Object();
// Konstruktor
soundfile = function (filedaten) {
        soundfile.className soundfile;
        soundfile.urlfile "http://mydomain/player/musik/" add file;
        soundfile.daten daten;
};
soundfile.prototype.abspielen = function() {
        soundfile.musikstueck = new Sound();
        soundfile.musikstueck.loadSound(soundfile.urlfilefalse);
        soundfile.totals getBytesTotal(soundfile.musikstueck);
        soundfile.musikstueck.onLoad = function() {
              if ((soundfile.spielt == 0)||(soundfile.spielt == undefined)) {
                       soundfile.musikstueck.start(soundfile.playerstatus1);
                       soundfile.spielt 1;
                       soundfile.playerstatus 0;
                } else {
                        stopAllSounds();
                        soundfile.spielt 0;
                }
        };
};
soundfile.prototype.pausieren = function () {
    getTimer();
    soundfile.playerstatus = (s/1000);
    soundfile.musikstueck.stop();
    soundfile.spielt 0;
};
soundfile.prototype.anhalten = function () {
    soundfile.musikstueck.stop();
    soundfile.spielt 0;
};

Der aufruf zum Abspielen

ActionScript-Quelltext

1
2
meinSound = new soundfile("mene.mp3""gruppe");
meinSound.abspielen();

Stoppen

ActionScript-Quelltext

1
meinSound.anhalten();

Pause Taste

ActionScript-Quelltext

1
meinSound.pausieren();


mfg Jürgen
Undefined Behavior (undefiniertes Verhalten) bedeutet meistens etwas ungültiges.
PHP Katepart - Speichenrechner - .htpasswd - RPM XDG Tool - Kcmnvview - QTidy
  • Go to the top of the page