在 C# 中动态加载 Flash 页面
我有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SwfObject 通常用于从 JavaScript 编写 Flash 标记,传递任何必要的参数。这比手动编写标签要干净一些。您可以通过服务器端调用嵌入 Flash 影片的名称,如下所示,或者使用纯 JavaScript。
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.