PassionateDeveloper
PassionateDeveloper

Reputation: 15138

ASP.Net and Flash animation: How to set the path?

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>

Upvotes: 0

Views: 968

Answers (2)

Aaron
Aaron

Reputation: 812

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

Upvotes: 1

Ray
Ray

Reputation: 21905

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

Upvotes: 0

Related Questions