首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >某些计算机上的axShockwaveFlash_FSCommand没有响应

某些计算机上的axShockwaveFlash_FSCommand没有响应
EN

Stack Overflow用户
提问于 2011-09-10 14:23:36
回答 1查看 344关注 0票数 0

我已经创建了一个C sharp项目,在其中我添加了一个ShockwaveFlashObject来播放我的swf文件。我面临的问题是,当我为我的项目创建安装程序时,它在安装时在我的机器上可以正常工作,但在我的笔记本电脑上,swf加载正确,但不响应_FSCommand。我不能使用try和catch块,因为它没有进入FSCommand句柄。我需要在安装时捆绑一些东西吗?我使用的笔记本电脑是全新的,我希望它是这样的,这样我就可以知道正确工作所需要的所有东西,这样我就可以在我的安装程序中添加先决条件。同样idk如果这个信息是任何用途,但我正在使用高级安装程序为我的项目构建和exe。

PS我已经添加了类似下面的代码,以了解FSCommand是否被执行。

代码语言:javascript
复制
MessageBox.Show("step 1/2/3");

下面是完整的代码。

代码语言:javascript
复制
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using System.IO;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Globalization;

namespace WindowsFormsApplication1
{
    public partial class frmFlashIntro : Form
    { 
      public Form FormfrmMainRef { get; set; }

        public frmFlashIntro()
        {
            InitializeComponent();
            axShockwaveFlash1.Playing = true;
            FormBorderStyle = FormBorderStyle.None;
            WindowState = FormWindowState.Maximized;
            string currentPath = Directory.GetCurrentDirectory();
            axShockwaveFlash1.Movie = "file://\\" + currentPath + "\\intro.swf"; 
         }

         private void axShockwaveFlash1_FSCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e)
        {
            MessageBox.Show("step 1");
            string btn = e.command.ToString();
            MessageBox.Show("step 2");
            if (btn == "play")
            {
                MessageBox.Show("step 3");
                try
                {
                    MessageBox.Show("step 4");
                    var form2 = new frmMain();
                    MessageBox.Show("step 5");
                    this.Hide();
                    MessageBox.Show("step 6");
                    form2.Show();
                }
                catch (Exception ex) { MessageBox.Show(ex.ToString()); }
            }
            if (btn == "syllabus")
            {
                MySqlConnection con = new MySqlConnection(Properties.Settings.Default.conString);
                con.Open();
                Syllabus_usageInformation syl = new Syllabus_usageInformation(this);
                MySqlCommand cmd = new MySqlCommand("SELECT ImageFiles FROM misc WHERE id=1", con);
                byte[] img = (byte[])cmd.ExecuteScalar();
                string strFn = Convert.ToString(DateTime.Now.ToFileTime());
                FileStream fs = new FileStream(strFn, FileMode.CreateNew, FileAccess.Write);
                fs.Write(img, 0, img.Length);
                fs.Flush();
                fs.Close();
                con.Close();
                syl.kpImageViewer1.OpenButton = false;
                syl.kpImageViewer1.ImagePath = strFn;
                syl.Show();
                this.Hide();
            }
            if (btn == "usageInformation")
            {   }
        }

     }
}
EN

回答 1

Stack Overflow用户

发布于 2011-09-17 01:35:22

您的笔记本电脑上是否安装了flash player ActiveX控件?您必须安装它,否则将无法播放您的.swf文件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7370026

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档