How to play SWF files in Delphi?

F-IN-BOX is a Delphi component to enhance Adobe Flash Player ActiveX features. It does not use its own engine to display movies but provide a wrapper around official flash.ocx code instead. Thus it is possible to avoid certain Macromedia / Adobe Flash Player ActiveX limitations.


Using F-IN-BOX you can play SWF files from any source: from a file, an URL, or from TStream:

{$RESOURCE 'res\movie.res'}   
...  
type   
   TMainForm = class(TForm)   
     FlashPlayerControl1: TFlashPlayerControl;   
...  
  end;   
...  
  
procedure TMainForm.PlayFromStream();   
var   
   ResourceStream: TResourceStream;   
begin   
   ResourceStream := TResourceStream.Create(0, 'EmbeddedMovie', 'FLASH');   
   FlashPlayerControl1.PutMovieFromStream(ResourceStream);   
   ResourceStream.Free;   
end;  
  
procedure TMainForm.PlayFromFile();   
begin   
   FlashPlayerControl1.PutMovie('C:\movie.swf');   
end;  
  
procedure TMainForm.PlayFromURL();   
begin   
   FlashPlayerControl1.PutMovie('http://f-in-box.com/movie.swf');   
end;