Created
December 28, 2011 10:19
-
-
Save JoanComasFdz/1527461 to your computer and use it in GitHub Desktop.
Basic WinForms control to contain a SWF Flash object.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
partial class WinFormsFlashControl :System.Windows.Forms.UserControl | |
{ | |
private Uri _source; | |
/// <summary> | |
/// Gets or sets the path to the .swf file. | |
/// </summary> | |
/// <exception cref="FileNotFoundException">Occurs when | |
/// the specified file is not found.</exception> | |
public Uri Source | |
{ | |
get { return _source; } | |
set | |
{ | |
_source = value; | |
flash_control.LoadMovie(0, value.LocalPath); | |
flash_control.Stop(); | |
} | |
} | |
public WinFormsFlashControl() | |
{ | |
InitializeComponent(); | |
} | |
/// <summary> | |
/// Plays or resumes the movie. | |
/// </summary> | |
public void Play() | |
{ | |
flash_control.Play(); | |
} | |
/// <summary> | |
/// Pauses the movie. To resume it, | |
/// call <see cref="Play()"/>. | |
/// </summary> | |
public void Pause() | |
{ | |
flash_control.Stop(); | |
} | |
/// <summary> | |
/// Stops the movie. | |
/// </summary> | |
public void Stop() | |
{ | |
flash_control.Stop(); | |
flash_control.FrameNum = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where does WindowsFormFlashControl come from?