贴子继续提前.
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, ShockwaveFlashObjects_TLB;
type
TForm1 = class(TForm)
Button1: TButton;
ShockwaveFlash1: TShockwaveFlash;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
uses comObj, ShellAPI;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShockwaveFlash1.play;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
ShockwaveFlash1.Stop;
end;
procedure TForm1.Button1Click(Sender: TObject);
const filename = 'c:/sample2.swf';
var vv, txt, obj: variant;
ii: integer;
begin
vv := CreateOLEObject('swfObjs.swfMovie');
vv.SetSize(6400, 3700);
txt := CreateOLEObject('swfObjs.swfObject');
obj := CreateOLEObject('swfObjs.swfObject');
obj.MakeRectangle(0, 0, 6380, 3680);
obj.SetRadialFill(255, 255, 255, 255, 255, 224, 224, 255);
obj.SetRadialFillCenter (3190, 1895);
obj.SetDepth(0);
vv.AddObject(obj);
obj.MakeFont('MyFont');
obj.AddGlyph('Arial', 'Hello,', ord('H'));
obj.AddGlyph('Arial', 'Bukoo', ord('B'));
txt.MakeText('HB', obj);
txt.translate(500, 1500);
txt.SetSolidFill(255, 0, 0, 250);
txt.Scale(65536 div 2, 65536 div 2);
vv.AddObject(txt);
for ii := 10 to 50do
begin
vv.GotoFrame(ii);
if ii >= 10 then
vv.RemoveObject(txt);
txt.rotate( (50-ii)*65536 * 9);
txt.Scale( (60-ii)*6553, (60-ii)*6553);
txt.SetSolidFill(255, 0, 0, (ii-9)*5);
vv.AddObject(txt);
end;
vv.WriteMovie(filename);
// ShellExecute(handle, 'open', filename, nil, nil, SW_SHOWNORMAL);
ShockwaveFlash1.Movie := filename;
ShockwaveFlash1.play;
end.