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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
program PlayMP3;
uses
Flash8;
{$FRAME_WIDTH 400}
{$FRAME_HEIGHT 300}
{$BACKGROUND 0}
type
TEditBox = class(TextField)
procedure onKeyDown;
end;
var
field: TextField;
box : TEditBox;
f1 : TextFormat;
music: Sound;
procedure TEditBox.onKeyDown;
begin
case Key.getAscii of
080: music.Start(0, 1);
083: music.Stop;
112: music.Start(0, 1);
115: music.Stop;
end;
end;
begin
f1 := TextFormat.Create('Arial', 16);
f1.color := clWhite;
box := TEditBox.Create(nil, 'input', 0, 0, 0, 0, 0);
box.type := 'input';
Key.addListener(box);
field := TextField.Create(nil, 'output', 1, 0, 0, 400, 300);
field.setNewTextFormat(f1);
field.text := 'FlashPascal MP3 Player'#13'Play=P '#13'Stop=S';
music := Sound.Create(_root);
//music.loadSound('abschied.mp3', false);
music.loadSound('http://www.notredamedeparis.fr/IMG/mp3/07_Magnificat_du_ton_royal.mp3', false);
end. |
Partager