I want to have a flash animation on my site.
When I insert a "http:..." ad开发者_如何学编程ress in the field "Data" and "Value" in the code, its completly okay But when I insert a "~/PATHHERE/FILEHERE.swf" in this fields, it don't function.
Code:
<object data="~/Images/Flash/banner.swf" type="application/x-shockwave-flash" width="936"
height="142">
<param name="movie" value="~/Images/Flash/banner.swf" />
</object>
<object data='<%= ResolveUrl("~/Images/Flash/banner.swf") %>' type="application/x-shockwave-flash" width="936" height="142">
<param name="movie" value='<%= ResolveUrl("~/Images/Flash/banner.swf") %>' />
</object>
I presume you want the ~ to refer to the application root. The problem is that the <object>
tag doesn't know anything about the ~ trick; it is for asp.net server controls only. Try removing it - the '/' should refer to your app root (unless your are running in a virtual site on a dev computer). Or use a full url. Or a relative path (../images/whatever).
精彩评论