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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| program mp3;
uses
Flash8, Sound;
{$FRAME_WIDTH 400}
{$FRAME_HEIGHT 300}
{$BACKGROUND $000000}
type
TEditBox=class(TextField)
procedure onKeyDown;
end;
var
f1,f2,f3 : TextFormat;
box : TEditBox;
field : TextField;
music : Sound;
s1,s2,s3 : String;
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',14);
f1.color:=$ffffff;
f1.Bold:=True;
f2:=TextFormat.Create();
f2.Italic:=True;
f3:=TextFormat.Create();
f3.Align:='center';
box:=TEditBox.Create(nil,'input',0,0,0,0,0);
box.type:='input';
Key.addListener(box);
field:=TextField.Create(nil,'output',1,10,10,380,280);
field.setNewTextFormat(f1);
s1:='IN MEMORIAM'+#13+#13+'Dietrich Fischer-Dieskau'+#13+#13+
'(1925-2012)'+#13+#13+#13;
s2:='Mein Gott! wann kommt das sch'+"ö"+'ne: Nun!'+#13+
'Da ich im Frieden fahren werde'+#13+
'Und in dem Sande k'+"ü"+'hler Erde'+#13+
'Und dort bei dir im Scho'+"ß"+'e ruhn.'+#13+
'Der Abschied ist gemacht:'+#13+
'Welt, gute Nacht!'+#13+#13+#13;
s3:='[P] Play abschied.mp3'+#13+'[S] Stop';
field.text := s1 + s2 + s3;
field.setTextFormat(Length(s1),Length(s1+s2),f2);
field.setTextFormat(0,Length(s1),f3);
music:=Sound.Create(_root);
music.loadSound('abschied.mp3',false);
end. |