菜鸟接触 delphi,求高手!
unitUnit1;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,F...
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, OleCtrls, ShockwaveFlashObjects_TLB;
type
TForm1 = class(TForm)
Panel1: TPanel;
ButtonOpen: TButton;
ButtonPlay: TButton;
ButtonStop: TButton;
ButtonClose: TButton;
LabelFrame: TLabel;
ShockwaveFlash1: TShockwaveFlash;
OpenDialog: TOpenDialog;
Timer: TTimer;
procedure ButtonOpenClick(Sender: TObject);
procedure ButtonCloseClick(Sender: TObject);
procedure TimerTimer(Sender: TObject);
procedure ButtonStopClick(Sender: TObject);
procedure ButtonPlayClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ButtonOpenClick(Sender: TObject);
begin
if OpenDialog.Execute then
begin
ShockwaveFlash.movie := OpenDialog.FileName;
end;
end;
procedure TForm1.ButtonCloseClick(Sender: TObject);
begin
ShockwaveFlash.Movie :='about:blank';
end;
procedure TForm1.ButtonStopClick(Sender: TObject);
begin
ShockwaveFlash.Stop
end;
procedure TForm1.ButtonPlayClick(Sender: TObject);
begin
SHockwaveFlash.Play;
end;
end;
procedure TForm1.TimerTimer(Sender: TObject);
begin
if ShockwaveFlash.FrameNum = -1 then
begin
LabelFrame.Caption := '当前没有加载影片';
end
else
begin
LableFrame.Caption :=
'当前为第' + inttostr(ShockwaveFlash.FrameNum) + '帧';
end;
end;
错误:
[Error] Unit1.pas(42): Object or class type required
[Error] Unit1.pas(48): Object or class type required
[Error] Unit1.pas(52): Object or class type required
[Error] Unit1.pas(57): Object or class type required
[Error] Unit1.pas(60): '.' expected but ';' found
[Error] Unit1.pas(64): Object or class type required
[Warning] Unit1.pas(64): Comparing signed and unsigned types - widened both operands
[Error] Unit1.pas(70): Undeclared identifier: 'LableFrame'
[Error] Unit1.pas(70): Missing operator or semicolon
[Error] Unit1.pas(71): Object or class type required
[Error] Unit1.pas(75): Declaration expected but end of file found
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
有几个错误是相同的!
首先感谢各位的帮助,程序可以运行,没错误提示!但~~~窗体上是有1个面板控件,3个按钮,1个标签,1个flash控件,1个opendialog控件,1个定时器控件。 为什么!!运行后是一片空白啊????? 不能上图,不知描述得是否清楚? 展开
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, OleCtrls, ShockwaveFlashObjects_TLB;
type
TForm1 = class(TForm)
Panel1: TPanel;
ButtonOpen: TButton;
ButtonPlay: TButton;
ButtonStop: TButton;
ButtonClose: TButton;
LabelFrame: TLabel;
ShockwaveFlash1: TShockwaveFlash;
OpenDialog: TOpenDialog;
Timer: TTimer;
procedure ButtonOpenClick(Sender: TObject);
procedure ButtonCloseClick(Sender: TObject);
procedure TimerTimer(Sender: TObject);
procedure ButtonStopClick(Sender: TObject);
procedure ButtonPlayClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ButtonOpenClick(Sender: TObject);
begin
if OpenDialog.Execute then
begin
ShockwaveFlash.movie := OpenDialog.FileName;
end;
end;
procedure TForm1.ButtonCloseClick(Sender: TObject);
begin
ShockwaveFlash.Movie :='about:blank';
end;
procedure TForm1.ButtonStopClick(Sender: TObject);
begin
ShockwaveFlash.Stop
end;
procedure TForm1.ButtonPlayClick(Sender: TObject);
begin
SHockwaveFlash.Play;
end;
end;
procedure TForm1.TimerTimer(Sender: TObject);
begin
if ShockwaveFlash.FrameNum = -1 then
begin
LabelFrame.Caption := '当前没有加载影片';
end
else
begin
LableFrame.Caption :=
'当前为第' + inttostr(ShockwaveFlash.FrameNum) + '帧';
end;
end;
错误:
[Error] Unit1.pas(42): Object or class type required
[Error] Unit1.pas(48): Object or class type required
[Error] Unit1.pas(52): Object or class type required
[Error] Unit1.pas(57): Object or class type required
[Error] Unit1.pas(60): '.' expected but ';' found
[Error] Unit1.pas(64): Object or class type required
[Warning] Unit1.pas(64): Comparing signed and unsigned types - widened both operands
[Error] Unit1.pas(70): Undeclared identifier: 'LableFrame'
[Error] Unit1.pas(70): Missing operator or semicolon
[Error] Unit1.pas(71): Object or class type required
[Error] Unit1.pas(75): Declaration expected but end of file found
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
有几个错误是相同的!
首先感谢各位的帮助,程序可以运行,没错误提示!但~~~窗体上是有1个面板控件,3个按钮,1个标签,1个flash控件,1个opendialog控件,1个定时器控件。 为什么!!运行后是一片空白啊????? 不能上图,不知描述得是否清楚? 展开
3个回答
展开全部
出现白的是因为你没有装flash播放器
ShockwaveFlash后面加个1 ShockwaveFlash1
'LableFrame' 换成 TLabel
OpenDialog 后面加个1 OpenDialog1
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, OleCtrls, ShockwaveFlashObjects_TLB;
type
TForm1 = class(TForm)
Panel1: TPanel;
Timer1: TTimer;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
Label1: TLabel;
OpenDialog1: TOpenDialog;
ShockwaveFlash1: TShockwaveFlash;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
ShockwaveFlash1.movie:= OpenDialog1.FileName;
end;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
ShockwaveFlash1.Movie :='about:blank';
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin
ShockwaveFlash1.Stop
end;
procedure TForm1.BitBtn4Click(Sender: TObject);
begin
SHockwaveFlash1.Play;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if ShockwaveFlash1.FrameNum = -1 then
begin
Label1.Caption := '当前没有加载影片';
end
else
begin
Label1.Caption :=
'当前为第' + inttostr(ShockwaveFlash1.FrameNum) + '帧';
end;
end;
end.
ShockwaveFlash后面加个1 ShockwaveFlash1
'LableFrame' 换成 TLabel
OpenDialog 后面加个1 OpenDialog1
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, OleCtrls, ShockwaveFlashObjects_TLB;
type
TForm1 = class(TForm)
Panel1: TPanel;
Timer1: TTimer;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
Label1: TLabel;
OpenDialog1: TOpenDialog;
ShockwaveFlash1: TShockwaveFlash;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
ShockwaveFlash1.movie:= OpenDialog1.FileName;
end;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
ShockwaveFlash1.Movie :='about:blank';
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin
ShockwaveFlash1.Stop
end;
procedure TForm1.BitBtn4Click(Sender: TObject);
begin
SHockwaveFlash1.Play;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if ShockwaveFlash1.FrameNum = -1 then
begin
Label1.Caption := '当前没有加载影片';
end
else
begin
Label1.Caption :=
'当前为第' + inttostr(ShockwaveFlash1.FrameNum) + '帧';
end;
end;
end.
更多追问追答
追问
是电脑没装吗?可是连按钮也没出现啊!
追答
是电脑没装,你去下载装下就可以了 我昨天晚上测试了 是SWF文件可以播放,但在公司就不可以
因为公司没有装
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
2012-04-17 · 知道合伙人软件行家
关注
展开全部
从你的代码中,我没有看到 ShockwaveFlash 这个对象的初始化代码。
在 interface 的 uses 部分,你虽然引入了 ShockwaveFlashObjects_TLB,但引入并不代表对象的建立,你可能还要手动建立这个对象的实例,并进行初始化。
Object or class type required 这句错误提示就是告诉你:需要对象或类。
此外,ShockwaveFlash1: TShockwaveFlash; ShockwaveFlash1是正确的名称。
在 interface 的 uses 部分,你虽然引入了 ShockwaveFlashObjects_TLB,但引入并不代表对象的建立,你可能还要手动建立这个对象的实例,并进行初始化。
Object or class type required 这句错误提示就是告诉你:需要对象或类。
此外,ShockwaveFlash1: TShockwaveFlash; ShockwaveFlash1是正确的名称。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
procedure TForm1.ButtonPlayClick(Sender: TObject);
begin
SHockwaveFlash.Play;
end;
end;
多了一个 "end;"
begin
SHockwaveFlash.Play;
end;
end;
多了一个 "end;"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询