hermes_32
24-08-2004, 18:51:58
Hola amigos. Como estais?
Mirad, tengo un problema al crear un TAnimate dinamicamente, y el problema esta en que no se me ejecuta el evento OnStop al terminar la secuencia avi.
Tengo el código siguiente:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Animate1: TAnimate;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure Terminaya(Sender : Tobject);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var Animacion : TAnimate;
begin
Animacion := TAnimate.create(self);
with Animacion do begin
parent := self;
parentcolor := False;
FileName := ruta del avi;
StartFrame := 1;
StopFrame := 8;
CommonAVI := aviNone;
Repetitions := 1;
top := 10;
left := 50;
visible := True;
Transparent := false;
color := clWhite;
onStop := Terminaya;
active := True;
end;
end;
procedure TForm1.Terminaya(Sender: Tobject);
begin
showmessage('ya se ha terminado');
end;
end.
No se cual es el problema pero cuando termina el avi, no sale el mensaje que tiene que salir. Qué estoy haciendo mal?
Gracias por la atención.
Mirad, tengo un problema al crear un TAnimate dinamicamente, y el problema esta en que no se me ejecuta el evento OnStop al terminar la secuencia avi.
Tengo el código siguiente:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Animate1: TAnimate;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure Terminaya(Sender : Tobject);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var Animacion : TAnimate;
begin
Animacion := TAnimate.create(self);
with Animacion do begin
parent := self;
parentcolor := False;
FileName := ruta del avi;
StartFrame := 1;
StopFrame := 8;
CommonAVI := aviNone;
Repetitions := 1;
top := 10;
left := 50;
visible := True;
Transparent := false;
color := clWhite;
onStop := Terminaya;
active := True;
end;
end;
procedure TForm1.Terminaya(Sender: Tobject);
begin
showmessage('ya se ha terminado');
end;
end.
No se cual es el problema pero cuando termina el avi, no sale el mensaje que tiene que salir. Qué estoy haciendo mal?
Gracias por la atención.