asp.net mvc - IIS7.5 not displaying Flash object -
i'm writing mvc web app in asp.net mvc, supposed serving flash object written 1 of colleagues. don't know flash; doesn't know c#/asp.net; hence question goes so!
the code on web page looks this:
<head> (blah blah blah...) <script type="text/javascript" src="/flashstuff/js/swfobject.js"></script> <script type="text/javascript"> var gp_mlm_flashvars = {}; gp_mlm_flashvars.remote = 'true'; gp_mlm_flashvars.streamprovider = 'localweb'; gp_mlm_flashvars.referer = ''; gp_mlm_flashvars.bgcolor = '#000033'; var gp_mlm_params = {}; gp_mlm_params.menu = 'false'; gp_mlm_params.allowfullscreen = 'true'; gp_mlm_params.salign = 'tl'; gp_mlm_params.scale = 'noscale'; gp_mlm_params.wmode = 'opaque'; gp_mlm_params.bgcolor = '#000033'; var gp_mlm_attributes = {}; gp_mlm_attributes.id = 'gp_mlm'; gp_mlm_attributes.name = 'gp_mlm'; swfobject.embedswf('/flashstuff/swf/gp_mlm.swf', 'gp_mlm', '100%', '100%', '9', '/flashstuff/expressinstall.swf', gp_mlm_flashvars, gp_mlm_params, gp_mlm_attributes); </script> </head> (etc.)
when debug page using vs development server, appears happily , works fine. if try debug using local iis (7.5) server, flash object doesn't loaded.
i'm guessing need on iis enable using flash object - what?
edit: problem partially solved; clue came "404" error (thanks @beliskner).
it appears when you're running under vs development server, root folder project folder, , in case "/flashstuff" comes directly off project folder, worked fine.
but when run off iis server, root folder default web site (or whatever site you're using). now, project url set "http://localhost/mytestapp", have prefix paths "/mytestapp", e.g.:
<script type="text/javascript" src="/mytestapp/flashstuff/js/swfobject.js"></script>
changed paths; works fine now.
this pretty ugly situation now, though - because hard coding deployment-specific information app! if decide deploy app onto iis server in folder called "myliveapp", have go around changing file references everywhere! , if want debug - what? go changing references "mytestapp"?
obviously i'm not first developer come against situation, , unthinkable have i'm saying above. trick dealing situation?
have setup iis mime types? have used firefox firebug check request isn't 404ing?
mime types
http://technet.microsoft.com/en-us/library/cc725608(ws.10).aspx - suggest using gui
extension: ".swf"
type is: "application/x-shockwave-flash"
firebug
firebug network monitor: http://getfirebug.com/network
edit use solve problem: http://www.dailycoding.com/posts/the_script_tag_runatserver_problem_solution_using_resolveurl.aspx
Comments
Post a Comment