Hi, I am new to this swfobject, and I am having trouble with the alternative content - it doesn't load when the flash content, for whatever reason is not available. When I remove the <script> tags from the code, the image I am using (alternative content) shows up. Can someone please help me debug? Thanks :)
here is the code from the site:
<div id="flashcontent"> <a href="van_der_rohe.html"><img src="img/furnished_room.jpg" height="280" width="507" alt="room furnished with a Barcelona Chair" style="text-align:center; margin-left:24px;"/></a>
</div>
<script type="text/javascript"> var so = new SWFObject("cf4uscroller.swf", "mymovie", "540", "280", "6", "#FFF"); so.write("flashcontent"); </script>
What do you mean? You purposely (or accidentally) pointed to a swf file which doesn't exist? In this case flash player will try to load the .swf file where you specified, but since there is nothing at the location, will just show a white box. The alternate content will only be show if:
a) The user doesn't have javascript enabled b) The user doesn't have the flash player version specified in the SWFObject definition (in yor example above flash player 6)
If the flash content isn't "available", then that is the designer's error, and SWFObject will not fix that for you. This is the same as if you tell an HTML page to show an image from a location which doesn't exist. (e.g if img/furnished_room.jpg didn't exist, you would get a red 'x' where the image is supposed to be)
Thanks for your help Aran, I guess I misunderstood what was supposed to happen - I was working on the site, and the swf file didn't work on the mac / safari, so I took down the flash file, and then I saw the alternative content didn't load either... would there be any other reason (from looking at my code) that you think I may be having a problem? It works on most systems I've tried, but not on my mac at home (on safari).