用delphi做flash播放器_Delphi

  • 内容
  • 评论
  • 相关

在窗体上添加opendialog1控件,一个timer控件,一个mianmenu控件,
一个trackbar1控件。

欢迎各位提出意见!!

以下是代码
unit flash;

interface

http://www.gaodaima.com/?p=65940用Delphi做flash播放器_Delphi

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Menus, OleCtrls, ShockwaveFlashObjects_TLB, ComCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    ShockwaveFlash1: TShockwaveFlash;
    OpenDialog1: TOpenDialog;
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    TrackBar1: TTrackBar;
    Timer1: TTimer;
    N2: TMenuItem;
    N3: TMenuItem;
    N4: TMenuItem;
    N5: TMenuItem;
    N6: TMenuItem;
    N7: TMenuItem;
    N8: TMenuItem;
    N9: TMenuItem;
    procedure N1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure TrackBar1Change(Sender: TObject);
    procedure N3Click(Sender: TObject);
    procedure N4Click(Sender: TObject);
    procedure N6Click(Sender: TObject);
    procedure N7Click(Sender: TObject);
    procedure N9Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.N1Click(Sender: TObject);
begin  //菜单打开的事件
if opendialog1.execute
then
if opendialog1.filename<>''
then
begin
shockwaveflash1.movie:=opendialog1.filename;
timer1.enabled:=true;
trackbar1.max:=shockwaveflash1.TotalFrames;
shockwaveflash1.Play;
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
timer1.enabled:=false;//初始化代码
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
trackbar1.position:=trackbar1.position+1;//时间响应
end;

procedure TForm1.TrackBar1Change(Sender: TObject);
begin
trackbar1.position:=shockwaveflash1.FrameNum;//trackbar1的响应
end;

procedure TForm1.N3Click(Sender: TObject);
begin
shockwaveflash1.Forward;//向前一帧
shockwaveflash1.play;
end;

procedure TForm1.N4Click(Sender: TObject);
begin
shockwaveflash1.back;//向后一帧
shockwaveflash1.play;
end;

procedure TForm1.N6Click(Sender: TObject);
begin
if opendialog1.filename<>''
then
begin
shockwaveflash1.Stop;//暂停命令
n6.checked:=true;
end;
end;

procedure TForm1.N7Click(Sender: TObject);
begin
shockwaveflash1.Play;//继续命令
n6.checked:=false;
end;

procedure TForm1.N9Click(Sender: TObject);
begin
shockwaveflash1.rewind;//返回第一帧命令
shockwaveflash1.play;
end;

end. 

欢迎大家阅读《用delphi做flash播放器_Delphi》,跪求各位点评,若觉得好的话请收藏本文,by 搞代码

原创文章,转载请注明: 转载自搞代码

本文链接地址: 用delphi做flash播放器_Delphi

微信支付二维码

微信 赏一包辣条吧~

支付宝支付二维码

支付宝 赏一听可乐吧~

评论

0条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注