Flash playback
First, make sure that there is a flash plug-in the computer, that is, the flash can be played when the IE browser browses the web page. In fact, an ActiveX component provided by Macromedia is used for flash playback. The actviex component is swflash. ocx, which can be found in the system directory. To reference a project, follow these steps:
1. Select "toolbox", right-click, and select "select item" from the shortcut menu ".
2. In the displayed "select toolbox items" dialog box, select the "COM components" tab.
3. In the COM component list, click the [browse] button and select \ system32 \ macromed \ Flash \ swflash. ocx in the dialog box ".
Common Methods for axshockwaveflash include.
Play () method, used to play an animation.
Stop () method, used to stop playing an animation.
Rewind () method, used for the first animation after playback.
Back (), used to play the previous animation.
The forward () method, used to play the last frame of the animation.
Now, create a new one in your new form.
Axshockwaveflash1, button1, button2, button3, button4, buttn5, buttn6, buttn7, openfiledialog1.
Then write the following code into each button.
Private void button#click (Object sender, eventargs e) // open the Flash file
{
Openfiledialog1.file = "Flash file (*. SWF) | *. SWF | all files (*. *) | *.*";
If (openfiledialog1.showdialog () = dialogresult. OK)
{
String myfilename = openfiledialog1.filename;
This. axshockwaveflash1.move = myfilename;
}
}
Private void button2_click (Object sender, eventargs E)
{// Pause playback
This. axshockwaveflash1.stop ();
}
Private void button3_click (Object sender, eventargs E)
{// Play the first frame
This. axshockwaveflash. Rewind ();
}
Private void button4_click (Object sender, eventargs E)
{// Play the last frame
This. axshockwaveflash1.back ();
}
Private void button5_click (Object sender, eventargs E)
{// Play the next frame
This. axshockwaveflash1.forward ();
}
Private void button6_click (Object sender, eventargs E)
{// Start playing
Thyis. axshockwaveflash1.rewind ();
This. asshockwaveflash1.play ();
}