public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { openFileDialog1.Filter = "*.swf|*.swf"; openFileDialog1.ShowDialog(); if (this.openFileDialog1.FileName.Trim() == "") return; try { this.axShockwaveFlash1.Movie = this.openFileDialog1.FileName; //浏览FLASH文件 } catch { //提示对话框 MessageBox.Show(this, "打开Flash文件错误!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } private void button2_Click(object sender, EventArgs e) { if (this.openFileDialog1.FileName.Length > 0) { this.axShockwaveFlash1.Play();//播放动画 } else { MessageBox.Show(this, "请选择要播放的Flash动画!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } private void button3_Click(object sender, EventArgs e) { if (this.openFileDialog1.FileName.Length > 0) { this.axShockwaveFlash1.Stop(); //停止播放动画 } else { MessageBox.Show(this, "请选择要播放的Flash动画!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } private void button6_Click(object sender, EventArgs e) { if (this.openFileDialog1.FileName.Length > 0) { this.axShockwaveFlash1.Rewind(); //播放第一帧动画 } else { MessageBox.Show(this, "请选择要播放的Flash动画!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } private void button5_Click(object sender, EventArgs e) { if (this.openFileDialog1.FileName.Length > 0) { this.axShockwaveFlash1.Back(); //播放上一帧动画 } else { MessageBox.Show(this, "请选择要播放的Flash动画!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } private void button4_Click(object sender, EventArgs e) { if (this.openFileDialog1.FileName.Length > 0) { this.axShockwaveFlash1.Forward();//播放下一帧动画 } else { MessageBox.Show(this, "请选择要播放的Flash动画!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
评论