Skip to content

Instantly share code, notes, and snippets.

@JoanComasFdz
Created December 28, 2011 10:19
Show Gist options
  • Save JoanComasFdz/1527461 to your computer and use it in GitHub Desktop.
Save JoanComasFdz/1527461 to your computer and use it in GitHub Desktop.
Basic WinForms control to contain a SWF Flash object.
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;
}
}
@CarlosOnline
Copy link

Where does WindowsFormFlashControl come from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment