在 C# 中动态加载 Flash 页面

发布于 2024-12-04 16:25:28 字数 2347 浏览 0 评论 0原文

我有 20 个不同的 Flash 文件,当用户输入邮政编码时我需要随机播放这些文件。我已经完成了这个项目,但我认为我的完成方式可以做得更好。我有 20 个具有 flash 对象的不同 aspx 文件。我使用 Random 类根据随机数将用户重定向到不同的 aspx 文件。有没有一种方法可以只拥有一个 aspx 文件,其中可以使用变量传递参数值和数据。这样,它更容易维护,而且我不必去 20 个不同的 aspx 文件来更新任何内容。这是 Flash 对象的样子。

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="960" height="952"
            id="HOT" align="middle">
            <param name="movie" value="../FlashFiles/FirstTime/HOT_00.swf" />
            <param name="quality" value="high" />
            <param name="bgcolor" value="#000000" />
            <param name="play" value="true" />
            <param name="loop" value="true" />
            <param name="wmode" value="transparent" />
            <param name="scale" value="showall" />
            <param name="menu" value="true" />
            <param name="devicefont" value="false" />
            <param name="salign" value="" />
            <param name="allowScriptAccess" value="sameDomain" />
            <!--[if !IE]>-->
            <object type="application/x-shockwave-flash" data="../FlashFiles/FirstTime/HOT_00.swf" width="960" height="952">
                <param name="movie" value="HOT.swf" />
                <param name="quality" value="high" />
                <param name="bgcolor" value="#000000" />
                <param name="play" value="true" />
                <param name="loop" value="true" />
                <param name="wmode" value="transparent" />
                <param name="scale" value="showall" />
                <param name="menu" value="true" />
                <param name="devicefont" value="false" />
                <param name="salign" value="" />
                <param name="allowScriptAccess" value="sameDomain" />
                <!--<![endif]-->
                <a href="http://www.adobe.com/go/getflash">
                    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
                        alt="Get Adobe Flash player" />
                </a>
                <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
        </object>

请指教!!谢谢!

I have 20 different flash files that i need to play randomly when a user enters a zip code. I am done with the project, but the way I have done it is I think could have been done a lot better. I have 20 different aspx files that have the flash object. I redirect users to different aspx files based on the random number using Random class. Is there a way to just have one aspx file where the param value and data could be passed using a variable. That way, its easier to maintain and i don't have to go to 20 different aspx files to update anything. Here is what the flash object looks like.

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="960" height="952"
            id="HOT" align="middle">
            <param name="movie" value="../FlashFiles/FirstTime/HOT_00.swf" />
            <param name="quality" value="high" />
            <param name="bgcolor" value="#000000" />
            <param name="play" value="true" />
            <param name="loop" value="true" />
            <param name="wmode" value="transparent" />
            <param name="scale" value="showall" />
            <param name="menu" value="true" />
            <param name="devicefont" value="false" />
            <param name="salign" value="" />
            <param name="allowScriptAccess" value="sameDomain" />
            <!--[if !IE]>-->
            <object type="application/x-shockwave-flash" data="../FlashFiles/FirstTime/HOT_00.swf" width="960" height="952">
                <param name="movie" value="HOT.swf" />
                <param name="quality" value="high" />
                <param name="bgcolor" value="#000000" />
                <param name="play" value="true" />
                <param name="loop" value="true" />
                <param name="wmode" value="transparent" />
                <param name="scale" value="showall" />
                <param name="menu" value="true" />
                <param name="devicefont" value="false" />
                <param name="salign" value="" />
                <param name="allowScriptAccess" value="sameDomain" />
                <!--<![endif]-->
                <a href="http://www.adobe.com/go/getflash">
                    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
                        alt="Get Adobe Flash player" />
                </a>
                <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
        </object>

Please advise!! Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世界和平 2024-12-11 16:25:28

SwfObject 通常用于从 JavaScript 编写 Flash 标记,传递任何必要的参数。这比手动编写标签要干净一些。您可以通过服务器端调用嵌入 Flash 影片的名称,如下所示,或者使用纯 JavaScript。

var flashvars = {};;
flashvars.basePath = "/";

var params = {};
params.allowScriptAccess = "always";
params.base = "/";
params.bgcolor = "#000000";             
params.wmode = "transparent";
params.scale = "noscale";
params.salign = 'tr';

swfobject.embedSWF("<%= GetRandomFlashMove() %>", 
                   "BaseLoader",
                   "976",
                   "561",
                   "10.0.0",
                   "/expressInstall.swf",
                   flashvars, params);

SwfObject is commonly used to write the flash tag from JavaScript, passing any necessary parameters. It's a bit cleaner than writing the tag manually. You can emebed the name of the flash movie by a server side call as shown below, or use pure JavaScript.

var flashvars = {};;
flashvars.basePath = "/";

var params = {};
params.allowScriptAccess = "always";
params.base = "/";
params.bgcolor = "#000000";             
params.wmode = "transparent";
params.scale = "noscale";
params.salign = 'tr';

swfobject.embedSWF("<%= GetRandomFlashMove() %>", 
                   "BaseLoader",
                   "976",
                   "561",
                   "10.0.0",
                   "/expressInstall.swf",
                   flashvars, params);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文