Reputation: 99
This code will open a Flash in a Window after being executed. Is there any way to do: When clicking the Flash (without adding any button), any event will occur?
private void Window_Loaded(object sender, RoutedEventArgs e)
{
string filePath = @"C:\Users\IBM\Desktop\snailrunner1.swf";
SWFFileHeader swfFile = new SWFFileHeader(filePath);
this.Width = swfFile.FrameSize.WidthInPixels;
this.Height = swfFile.FrameSize.HeightInPixels;
WindowsFormsHost host = new WindowsFormsHost();
FormFlashLibrary.FlashAxControl play = new FormFlashLibrary.FlashAxControl();
host.Child = play;
grdMain.Children.Add(host);
play.Width = (int) this.Width;
play.Height = (int) this.Height;
play.LoadMovie(filePath);
play.Play();
}
Upvotes: 0
Views: 692
Reputation: 1479
Depends what you want to achieve.
If you just want to handle click event of the WindowsFormHost, which could be considered as a container, there are several events exposed: WindowsFormsHost Class
If you want to respond to a specific flash control inside the flash content it's required that it's exposed by the flash itself. Using the external API with an ActiveX container
Upvotes: 1