//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "MainUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "FlashPlayerControl"
#pragma resource "*.dfm"
#pragma resource "res\\movie.res"
TMainForm *MainForm;
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::ButtonPlayEmbeddedMovieClick(TObject *Sender)
{
  TResourceStream* ResourceStream = new TResourceStream(0, "Movie", "FLASH");
  FlashPlayerControl1->LoadMovieFromStream(0, ResourceStream);
  delete ResourceStream;
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::ButtonPlayFromFileClick(TObject *Sender)
{
  if (OpenDialog->Execute())
     FlashPlayerControl1->Movie = OpenDialog->FileName;
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::FormCreate(TObject *Sender)
{
  TResourceStream* ResourceStream = new TResourceStream(0, "Movie", "FLASH");
  FlashPlayerControl1->LoadMovieFromStream(0, ResourceStream);
  delete ResourceStream;

  OpenDialog->InitialDir = ExtractFileDir(Application->ExeName);
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::ButtonAboutClick(TObject *Sender)
{
  ShellExecute(0, NULL, "http://www.f-in-box.com/delphi/", NULL, NULL, SW_SHOW);
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::ButtonOrderClick(TObject *Sender)
{
  ShellExecute(0, NULL, "http://www.f-in-box.com/delphi/order.html", NULL, NULL, SW_SHOW);
}
//---------------------------------------------------------------------------
