此代码将在执行后在窗口中打开Flash。有没有办法:当点击Flash(不添加任何按钮)时,会发生任何事件?
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();
}
答案 0 :(得分:1)
取决于你想要达到的目标。
如果您只想处理可被视为容器的WindowsFormHost的click事件,则会暴露几个事件:WindowsFormsHost Class
如果您想要响应闪存内容中的特定闪光控制,则需要闪光灯本身曝光。 Using the external API with an ActiveX container