First, your machine must have Flash playback software (your IE can display Flash). IE can display Flash is installed
Swflash.ocx control provided by Macromedia, we can use $Windows/System/Macromed/Flash in Win98
Or find it in $Winnt/System32/Macromed/Flash in Win2000. ActiveX controls are universal in Windows.
Delphi also supports it.
First, your machine must have Flash playback software (your IE can display Flash). IE can display Flash is installed
Swflash.ocx control provided by Macromedia, we can use $Windows/System/Macromed/Flash in Win98
Or find it in $Winnt/System32/Macromed/Flash in Win2000. ActiveX controls are universal in Windows.
Delphi also supports it.
After running Delphi, select the menu Component→Import ActiveX Control and find the SWFlash.OCX file to install.
After the installation is completed, the TShockwaveFlash control appears in the ActiveX panel. This is the package of SWFlash.OCX by Delphi. Now we
You can use this control to play Flash. Drag a Flash over, put it on the Form, specify its Movie attribute to d:/test.SWF.
And press F9 to run. How about it, it works well, right? Below, the author will introduce the main properties of TShockwaveFlash,
Methods and events for reader development.
The main properties of TShockwaveFlash are as follows:
ReadyState: The status when reading a flash file, including 0=Loading, 1=Uninitialized, 2=Loaded, 3=Interactive and 4=Complete;
TotalFrames: Total frame count, this property can only be accessed when ReadyState = 4;
FrameNum: The currently played frame;
Playing: Play or pause a flash;
Quality: Specify the quality of the current rendering, including 0=Low, 1=High, 2=AutoLow, 3=AutoHigh;
ScaleMode: Scaling mode, 0=ShowAll, 1=NoBorder, 2=ExactFit;
AlignMode: Align mode, Left=+1, Right=+2, Top=+4, Bottom=+8;
BackgroundColor: Background color, -1 is the default color;
Loop: Whether to loop;
Movie: Specifies the playback flash file path, which can be a URL.
The main methods of TShockwaveFlash are as follows:
Play(): Start playing animation;
Stop(); stop playing animation;
Back(); play the previous animation;
Forward(): play the next frame of animation;
Rewind(): Play the first frame of animation;
SetZoomRect(int left, int top, int right, int bottom): Set the zoomed area;
Zoom(int percent): Scale by percentage;
Pan(int x, int y, int mode): Scales the playback panel, where mode 0 is the number of images and 1 is the percentage by window.
The main events of TShockwaveFlash are as follows:
OnPRogress(int percent): fired when reading a flash;
OnReadyStateChange(int state): fired when the state changes. The values of states can be 0=Loading, 1=Uninitialized, 2=Loaded, 3=Interactive and 4=Complete.