tags:

views:

33

answers:

2

Hi,

I want to have a flash animation on my site.

When I insert a "http:..." adress 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>
A: 

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).

Ray
+1  A: 
<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>
Aaron