Flash - статьи



              

Текст модуля для демонстрации методов SetVariable и GetVariable


unit Unit1;

interface

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, OleCtrls, ShockwaveFlashObjects_TLB, ExtCtrls, StdCtrls;

type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; Button1: TButton; Edit1: TEdit; ComboBox1: TComboBox; Button2: TButton; Panel1: TPanel; ShockwaveFlash1: TShockwaveFlash; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure ComboBox1Change(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;

var Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject); begin ShockwaveFlash1.Movie := ExtractFilePath(Application.ExeName) + 'DelphiToFlash.swf'; Label3.Caption := ShockwaveFlash1.GetVariable ('DelphiText.borderColor'); end;

procedure TForm1.Button1Click(Sender: TObject); begin ShockwaveFlash1.SetVariable ('DelphiVarText', StringToOleStr(Edit1.Text)); end;

procedure TForm1.ComboBox1Change(Sender: TObject); begin ShockwaveFlash1.SetVariable ('DelphiText.borderColor', StringToOleStr(ComboBox1.Text)); end;

procedure TForm1.Button2Click(Sender: TObject); begin Label3.Caption := ShockwaveFlash1.GetVariable ('DelphiText.borderColor'); end;

end.




Содержание  Назад  Вперед