那位高手可以告诉我,如何使一幅falsh动画在用delphi程序设计的程序里动起来?

解决方案 »

  1.   

    //首先,你的先装Flash程序,因为,只有这样你才有Flash控件;
    //安装方法:(1)先File->Closs all;
    //(2)Componment->Install ActiveX Componment;
    //(3)在列表框中选择Flash控件,然后就可以点Install;
    //(4)在控件栏的ActiveX页就可以看到了
    //以下,是个范例,你看看吧!!好的话,可要给我加多点分啊!!!
    //给分多点啊!呵呵
    unit uMain;interfaceuses
      Windows, Messages, Forms, ShockwaveFlashObjects_TLB,
      AppEvnts, ExtCtrls, OleCtrls, Classes, Controls;type
      TForm1 = class(TForm)
        ApplicationEvents1: TApplicationEvents;
        Panel1: TPanel;
        ShockwaveFlash1: TShockwaveFlash;
        procedure FormShow(Sender: TObject);
        procedure Panel1Resize(Sender: TObject);
        procedure FormKeyDown(Sender: TObject; var Key: Word;
          Shift: TShiftState);
        procedure ApplicationEvents1Message(var Msg: tagMSG;
          var Handled: Boolean);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormShow(Sender: TObject);
    begin
      Panel1.Align:=alNone;
      with Panel1 do SetBounds(Left, Top, Width-1, Height-1);
      with Panel1 do SetBounds(Left, Top, Width+1, Height+1);
      Panel1.Align:=alClient;    ShockwaveFlash1.Play;
    end;procedure TForm1.Panel1Resize(Sender: TObject);
    begin
      //使Flash全屏播放
      ShockWaveFlash1.SetBounds(0,0,screen.width, screen.height);
    end;procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      //Escape 关闭程序
      if Key = VK_ESCAPE then
        Close;
    end;procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
      var Handled: Boolean);
    begin
      if msg.message = WM_RBUTTONDOWN then
      begin
        //去掉Flash控件的默认菜单
        Handled := True;
      end;
    end;end.