Delphi6.0下测试通过! 需要TShokewaveFlash控件!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, ShockwaveFlashObjects_TLB, ComCtrls,
ExtCtrls, Menus, DIRECTORSHOCKWAVELib_TLB;
type
TForm1 = class(TForm)
ShockwaveFlash1: TShockwaveFlash;
Button1: TButton;
Button2: TButton;
Pro: TProgressBar;
Timer1: TTimer;
Label1: TLabel;
OpenDialog1: TOpenDialog;
Button4: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.Text = '' then
Exit
else
ShockwaveFlash1.Movie:=edit1.Text;
ShockwaveFlash1.Play;
Timer1.Enabled :=true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShockwaveFlash1.Stop;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
pro.Max:= ShockwaveFlash1.TotalFrames
pro.Position :=ShockwaveFlash1.CurrentFrame;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Timer1.Enabled :=false;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
OpenDialog1.Execute;
Edit1.Text :=OpenDialog1.FileName;
end;
end.