Flash 参数在 URL 上添加控制器,无法找到要播放的文件
我有一个嵌入式 Flash 对象,其中包含一个使用 url 作为参数的电影参数。当在客户端上解析此 URL 时,将使用完整的友好 URL,并且 .swf 的链接将不正确。
这是 HTML:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="100" height="30" id="MyId" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Content/MyApp.swf?parm='/sounddir/mysound.mp3'" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="/Content/MyApp.swf?parm='/sounddir/mysound.mp3'" quality="high" bgcolor="#ffffff" width="100"
height="30" name="MyApp" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
发生的是 url(例如) http://www.domain .com/MyContoller/MyAction?someid=4 电影参数的值最终为:
MyContoller/'/sounddir/mysound.mp3'
我尝试了 Url.Content、ResolveUrl 等的每种组合,但这一切都发生在服务器上,对客户端没有任何帮助。我还试图弄清楚如何使用路线图做一些事情,但没有成功...我什至无法摆脱错误 URL 中间的“'/”...
当然会感激帮助这...有关于如何在 MVC 2 中使用 flash 的好博客吗?
提前致谢。
I have an embedded flash object with a movie parameter that uses a url as a parameter. When this URL is resolved on the client the full friendly url is used and the link to the .swf is then incorrect.
Here is the HTML:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="100" height="30" id="MyId" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Content/MyApp.swf?parm='/sounddir/mysound.mp3'" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="/Content/MyApp.swf?parm='/sounddir/mysound.mp3'" quality="high" bgcolor="#ffffff" width="100"
height="30" name="MyApp" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
What happens is the url (for example) http://www.domain.com/MyContoller/MyAction?someid=4
the value for the movie parms winds up with:
MyContoller/'/sounddir/mysound.mp3'
I tried every combination of Url.Content, ResolveUrl etc. but that all happens on the server and is no help on the client. I also tried to figure out how to do something with the route maps, but no success there...I can't even get rid of the "'/" in the middle of the incorrect URL...
Sure would appreciate help on this...any good blogs out there on how to use flash with MVC 2?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法给出确切的答案,但需要注意以下几点:
您确定 swf 需要带引号的 parm 吗?更常见的是发送不带引号的 URL 参数,例如“/Content/MyApp.swf?parm=/sounddir/mysound.mp3”。
在 swf 文件的 URL 中附加参数的替代方法是使用 flashvars。如果您从将参数附加到 swf URL 切换为使用 flashvars,则 Flash 中的 ActionScript 不需要更改,它将在内部以相同的方式检索值。
I can't give an exact answer, but a couple of things to look in to are:
Are you sure the swf expects the parm with the quotes? It is more common to send URL parameters like that without quotes, like "/Content/MyApp.swf?parm=/sounddir/mysound.mp3".
An alternative to appending the parameter in the URL of the swf file is using flashvars. The ActionScript in the Flash doesn't need to be altered if you switch from appending the parameter to the swf URL to using flashvars, it will retrieve the value the same way internally.