Flash is produced by Macromedia and is used for dynamic and interactive shockwave on the Internet. its
The advantage is that it is small in size and can be played while downloading, thus avoiding long waiting for users.
FLASH can be used to generate animations and add sounds to web pages. This way you can generate multimedia graphics and interfaces while keeping the file size small.
Although FLASH cannot be programmed like a language, it can use its built-in statements combined with
With javaSCRipE, you can also create a highly interactive homepage.
Another feature of FLASH is that the plug-in PLUG-IN must be installed in order to be accepted by the browser! Of course this is also
Avoid differences between browsers and treat them equally!
But you know what? In Delphi, you can directly open the flash animation and control it to play and stop. You still
Can I get its total number of frames? Do you know how to achieve it? plz follow me.
Select "Shockwave" in Component|Import ActiveX Controls... in delphi
Flash (Version 1.0)" and click Install, an install window will appear.
If you want to add it to an existing package, in the "into existing package" dialog box
Select the path you want to install in the "File name:" window and click "OK"; a confirmation dialog box will pop up.
Ask you "Package dclusr50.bpl will be rebuilt. Continue?", click "Yes"; in the pop-up window
Just click "install" and the plug-in will be installed.
If you want to add it to a new package, click "File" in the "into new package" dialog box.
name:" window, select the path you want to install, and create a new package, if named test, and click "OK"; it
Ask you "Package test.bpl will be built. Continue?", click "Yes". Order in the pop-up window
Click "install" and the plug-in is installed.
At this time, you will find a new control under ActiveX in the control bar named ShockwaveFlash.
Click it and put it in the form, put an OpenDialog control and a panel in the form, and put
Four buttons, their caption attributes are named "Openfile", "Play", "Stop", "Close" respectively. Settings
panel1, the Align properties of ShockwaveFlash are Alleft and AlClient respectively; in these four
Write the following code in Button's OnClick event:
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;
You can get the total number of frames of the opened flash image, add a label on panel1, and add a label on form1
Write the following code in the OnClick event
procedure TForm1.FormCreate(Sender: TObject);
begin
label1.caption:=shockwaveflash.totalframes;
end;
You can also control the opened flash image to start playing from that frame.
Add a button and an Edit control on panel1,
Add the following code to the button's OnClick event.
if ShockwaveFlash1.playing then
ShockwaveFlash1.GotoFrame(SpinEdit1.Value);
ShockwaveFlash1.Play;
Fill in the frame you want to jump to in the edit and click the button to implement this function.
How about it, give it a try, the effect is pretty good, right?