⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 041.htm

📁 Delphi书籍--Delphi网上教程
💻 HTM
字号:
<HTML><HEAD><meta http-equiv="Content-Type" content="text/html; charset=GB2312"><TITLE>-->DELPHI专题文档-程序应用-->在delphi中使用flash控件</TITLE>
<META NAME="keywords" CONTENT=" DELPHI专题文档-程序应用 在delphi中使用flash控件">
<META NAME="description" CONTENT=" - DELPHI专题文档-程序应用 - 在delphi中使用flash控件">

<style>
<!--
#page {position:absolute; z-index:0; left:0px; top:0px}
.tt3 {font: 9pt/12pt "宋体"}
.tt2 {font: 12pt/15pt "宋体"}
a {text-decoration:none}
a:hover {color: blue;text-decoration:underline}
-->
</style>
</HEAD>
<a href="index6.html">返回</a>

<body text="#000000" aLink=#9900ff link=#006699 vLink=#006699 bgcolor="#FFFFFF" leftmargin="3" topmargin="3" marginheight="3" marginwidth="3">
<TABLE WIDTH="100%" CELLPADDING=10 CELLSPACING=0 BORDER=0>
<TR>

<TD class="tt2" bgcolor="#F5F8F8" width="84%"><center><B><FONT style="FONT-SIZE: 16.5pt" COLOR="#FF6666" FACE="楷体_GB2312">在delphi中使用flash控件</FONT></B></center>
<hr color="#EE9B73" size="1" width="94%">
<p><span style="font-size: 9pt"><font color="#ffffff">----</font> FLASH是Macromedia公司出品的,用在互联网上动态的、可互动的shockwave。它的优点是体积小,可边下载边播放,这样就避免了用户长时间的等待。 
</span> 
<p><span style="font-size: 9pt"><font color="#ffffff">----</font>     FLASH可以用其生成动画,还可在网页中加入声音。这样你就能生成多媒体的图形和界面,而使文件的体积却很小。
</span>
<p><span style="font-size: 9pt"><font color="#ffffff">----</font> FLASH虽然不可以象一门语言一样进行编程,但用其内置的语句并结合JAVASCRIPE,您也可作出互动性很强的主页来。 
</span> 
<p><span style="font-size: 9pt"><font color="#ffffff">----</font>    FLASH另外一个特点就是必须安装插件PLUG-IN,才能被浏览器所接受!当然这也避免了浏览器之间的差异,使之一视同仁!
</span>
<p><span style="font-size: 9pt"><font color="#ffffff">----</font> 但是你知道吗?在delphi中可以直接打开flash动画,并控制它播放和停止。你还可以得到它的总帧数,知道怎么实现的吗?请跟我来。 
</span> 
<p><span style="font-size: 9pt"><font color="#ffffff">----</font> 在delphi中的Component|Import 
ActiveX Contrals...中选中 &quot;Shockwave Flash(Version 1.0)&quot;,并单击Install,会出现一个install窗口。 
</span> 
<p><span style="font-size: 9pt"><font color="#ffffff">----</font> 
如果要把它添加到一个已经存在的包中,在&quot;into existing package&quot;对话框中的&quot;File 
name:&quot;窗口中选择你想安装的路径,并单击&quot;OK&quot;;会弹出一个确认的对话框,它问你&quot;Package 
dclusr50.bpl will be rebuilt. Continue?&quot;,单击&quot;Yes&quot;;在弹出的窗口中单击击&quot;install&quot;,该插件就安装完毕。 
</span> 
<p><span style="font-size: 9pt"><font color="#ffffff">----</font> 
如果要把它添加到一个新建的包中,在&quot;into new package&quot;对话框中的 
&quot;File name:&quot;窗口中选择你想安装的路径,并新建一个包,假如命名为test,并单击&quot;OK&quot;;它问你&quot;Package 
test.bpl will be built. Continue?&quot;,单击&quot;Yes&quot;。 
在弹出的窗口中单击击&quot;install&quot;,该插件就安装完毕。 </span> 
<p><span style="font-size: 9pt"><font color="#ffffff">----</font> 
   这时,你会在控件条的ActiveX下发现一个新的控件,名字为ShokewaveFlash, 
单击它把它放在form中,在该form中放一个OpenDialog控件和一个panel,在该panel上放四个button,他们的caption属性分别命名为&quot;Openfile&quot;,&quot;Play&quot;,&quot;Stop&quot;,&quot;Close&quot;.设置panel1,ShockwaveFlash的Align 
属性分别为Alleft 和AlClient; 分别在这四个Button的OnClick事件中写下如下代码: 
</span></p> 
<BR> 
<pre><span style="font-size: 9pt">


procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
ShockwaveFlash1.Movie:=
OpenDialog1.FileName;
end;


procedure TForm1.Button2Click(Sender: TObject);
begin
ShockwaveFlash1.Play;
end;


procedure TForm1.Button3Click(Sender: TObject);
begin
ShockwaveFlash1.StopPlay;
end;


procedure TForm1.Button4Click(Sender: TObject);
begin
ShockwaveFlash1.FreeOnRelease;
close;
end;


</span></pre> 
<BR> 
<p><span style="font-size: 9pt"><font color="#ffffff">----</font> 你可以得到打开的flash图像的总帧数,在panel1上添加一个label,在form1的OnClick事件中写下如下代码 
</span></p> 
<BR> 
<pre><span style="font-size: 9pt">
procedure TForm1.FormCreate(Sender: TObject);
begin
label1.caption:=shockwaveflash.totalframes;
end;


你还可以控制该打开的flash图像从那一帧开始播放,
在panel1上添加一个button和一个Edit控件,


在该button的OnClick事件中添加如下代码。
if ShockwaveFlash1.playing then
ShockwaveFlash1.GotoFrame(SpinEdit1.Value);
ShockwaveFlash1.Play;
</span></pre> 
<BR> 
<p><span style="font-size: 9pt"><font color="#ffffff">----</font> 在edit中填上你想跳到的帧,并单击该button,你即可实现该功能。 
</span> 
<p><span style="font-size: 9pt"><font color="#ffffff">----</font> 
怎么样,试试吧,效果还不错吧。 </span></p> 
<hr color="#EE9B73" size="1" width="94%"> 
 
</TD> 
 
</TR> 
</table> 
</BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -