Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  135

•  TDictionary Custom Sort  3 315

•  Fast Watermark Sources  3 065

•  3D Designer  4 825

•  Sik Screen Capture  3 320

•  Patch Maker  3 535

•  Айболит (remote control)  3 637

•  ListBox Drag & Drop  2 996

•  Доска для игры Реверси  81 559

•  Графические эффекты  3 927

•  Рисование по маске  3 231

•  Перетаскивание изображений  2 613

•  Canvas Drawing  2 735

•  Рисование Луны  2 561

•  Поворот изображения  2 166

•  Рисование стержней  2 161

•  Paint on Shape  1 564

•  Генератор кроссвордов  2 226

•  Головоломка Paletto  1 764

•  Теорема Монжа об окружностях  2 214

•  Пазл Numbrix  1 682

•  Заборы и коммивояжеры  2 052

•  Игра HIP  1 279

•  Игра Go (Го)  1 224

•  Симулятор лифта  1 471

•  Программа укладки плитки  1 214

•  Генератор лабиринта  1 542

•  Проверка числового ввода  1 352

•  HEX View  1 490

•  Физический маятник  1 355

 
скрыть


Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Проиграть Flash файл в приложении



Мой компьютер постоянно обыгрывает меня в шахматы. Зато я всегда побеждаю его в боксерском поединке!

To make use of SWF files in your Delphi application you should have the swf plugin installed then follow these steps:

{English}

In the Delphi IDE

- click on "Component", "Import ActiveX Control"
- chose "Shockwave Flash" and click on "install".

Now you have a TShockwaveFlash component in your IDE on the ActiveX tabsheet. Place the TShockwaveFlash Component onto your form, resize it as needed but for now do not assign a movie to it.

You will need to register the ocx file if it is not installed on the target computer. So you should have a resource file with

- the swflash.ocx and your Flash ( *.swf) file.
- Copy swflash.ocx (from i.e. windows\system32\macromed\flash) and your custom swf file to your project path.
- Create a textfile with a code like this:

SHOCKWAVEFILE RCDATA yourfile.swf
SHOCKWAVEOCX RCDATA swflash.ocx

(Where yourfile.swf is your swf-file)

- Save this file as flash.rc
- Goto Commandline, change to your project dir and enter the line:

"Brcc32 -r flash.rc"

- Now you have your new resource as flash.res file


uses 
  ShockwaveFlashObjects_TLB; // will be used automatically 

implementation 

{$R *.DFM} 
{$R flash.res} // your new created resource 
{...} 

procedure TForm1.FormCreate(Sender: TObject); 
var 
  SystemDir: array[0..MAX_PATH] of Char; 
  SWFDir, AppDir: string; 
  Fres: TResourceStream; 
  Ffile: TFileStream; 
begin 
  GetSystemDirectory(@SystemDir, MAX_PATH); 
  SWFDir := SystemDir + '\macromed\flash\'; 
  GetDir(0, AppDir); // Get current directory 

  //check whether the sw-flash ocx is already installed 
  if FileExists(SWFDir + 'swflash.ocx') = False then 
  begin 
    //create directories if needed and extract file from resource. 
    {$i-} //compiler directive to suppress i/o error messages 
    MkDir(SystemDir + '\macromed'); 
    MKDir(SystemDir + '\macromed\flash'); 
    {$i+} 
    Fres := TResourceStream.Create(0, 'SHOCKWAVEOCX', RT_RCDATA); 
    Ffile := TFileStream.Create(SWFDir + 'swflash.ocx', fmCreate); 
    Ffile.CopyFrom(Fres, Fres.Size); 
    Fres.Free; 
    Ffile.Free; 

    //register ocx (simple but useful) 
    WinExec(PChar('regsvr32 /s ' + SWFDir + 'swflash.ocx'), SW_HIDE); 
  end; 
  // extract ShockwaveFile from resource to application directory 
  Fres := TResourceStream.Create(0, 'SHOCKWAVEFILE', RT_RCDATA); 
  Ffile := TFileStream.Create('flashmovie.swf', fmCreate); 
  Ffile.CopyFrom(Fres, Fres.Size); 
  Fres.Free; 
  Ffile.Free; 

  //Assign the extracted swf file to your TShockwaveFlash object 
  FlashMovie.Movie := AppDir + '\flashmovie.swf'; 
end; 

(* 
  If you dont want to have the popup menu displayed on right click 
  you may chose menu property of TShockWave to false. 
*)





Похожие по теме исходники

Flash Core

Flash Drive Computer Locker

Disable Flash

Flash and CD-ROM Safe Removal

 

Чтение PSD файлов

Шифратор файлов

Разбиение файла на части

Поиск файлов

 

FileMan (менеджер файлов)

Поиск открытых файлов

Текст внутри файла




Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте