faqts : Computers : Programming : Languages : Delphi

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 16 people (63%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

Delphi: Graphics: File: Animation: Flash: Create: How to create flash .swf files in Delphi? [Bukoo]

Oct 10th, 2003 15:57
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 10 October 2003 - 00:41 am --------------------

Delphi: Graphics: File: Animation: Flash: Create: How to create 
flash .swf files in Delphi? [Bukoo]

---

Method: use the 'Bukoo' package

Bukoo is a package which contains 3 Windows COM Objects to create Flash
movie. These objects can be used in Delphi, VB, ASP or any other
programming environment that supports Automation Objects to create
Flash movie without Flash yet most importantly by your program
dynamically.

http://bukoo.sourceforge.net/

---
---

Example using Bukoo with Delphi

Sample 2: Rotating Text, click here for the source.

http://bukoo.sourceforge.net/src_sample_2.htm

---
---

Example of use (from the Chinese manual)

[Internet: source: http://bukoo.sourceforge.net/bukooFlashObjects.doc]

---

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
// Flash ActiveX Control
    ShockwaveFlash1.play;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
// Flash ActiveX Control
    ShockwaveFlash1.Stop;
end;

procedure TForm1.Button1Click(Sender: TObject);
const filename = 'c:\sample2.swf';
var vv, txt, obj: variant;
      ii: integer;
begin
	// Bukoo Flash Objects
    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 50 do 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;
	// SWF
    vv.WriteMovie(filename);
//  SWF Flash ActiveX Control
    ShockwaveFlash1.Movie := filename;
    ShockwaveFlash1.play;
end;
end.


---
---

Internet: see also:

---

Delphi: Graphics: File: Animation: Flash: Run: How to run flash .swf 
files from Delphi?
http://www.faqts.com/knowledge_base/view.phtml/aid/25321/fid/175

---

Ming is a C library for generating SWF ("Flash") format movies, plus a 
set of wrappers for using the library from c++ and popular scripting 
languages like PHP, Python, and Ruby.
http://ming.sourceforge.net/

---

How to convert your jpeg/jpg files to flash .swf files? [jpg2swf]
http://www.zarinmedia.com/software/

----------------------------------------------------------------------