PDA

View Full Version : swfobject help!! can't figure out alt content


gnaiz
04-08-2010, 01:07 AM
Hi. I am relatively new to flash. In fact, I am using a map building program that generates the swf code and such. I am trying to use swfobject to display an image when the use does not have flash. However, as I am pretty new to coding and all, I can't for the life of me figure out the correct code to place on my site because the code the program is generating is signifcantly more complex than that shown in the example on the swfobject help.

Below is the code I have. It works fine when I use without swfobject and paste directly to my pages.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"
width="400" height="100%" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="http://www.mysite.com/map3/imapbuilder/loader.swf" />
<param name="base" value="http://www.mysite.com/map3/imapbuilder/" />
<param name="flashvars" value="datasource=CountriesMap1.xml" />
<param name="loop" value="false" />
<param name="menu" value="true" />
<param name="quality" value="best" />
<param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
<embed src="http://www.mysite.com/map3/imapbuilder/loader.swf" base="http://www.mysite.com/map3/imapbuilder/"
flashvars="datasource=CountriesMap1.xml"
loop="false" menu="true" quality="best" wmode="transparent"
bgcolor="#ffffff" width="400" height="100%" align="middle"
allowScriptAccess="always" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
</object>
Can someone help me figure out the html code i need to embed for use with the above flash code? I am just confused based on all the examples where there is a link just to the .swf file.

Any help producing the correct code would be greatly appreciated. Thanks!


Also, I am primarily using swfobject so I can have an alternate image displayed for non flash users. For example:
<a href="http://mysite.com"><img
style="border: 0px solid ; width: 400px; height: 300px;"
alt="No Flash!"
src="http://mysite.com/images/flash_replacement.jpg"></a>

nredes
04-08-2010, 03:44 PM
Hi there,

I am fairly new to this also, and I've researched dozens of sites all over for help. I found this page recently that goes over how to embed flash using the swfobject feature. I hope this helps some!

http://www.pixelmill.com/(3ofbrdmfncypx9nubr7hx1l7)/support/support_article.aspx?ArticleID=kb101619

UncleNinja
04-08-2010, 04:05 PM
Have you tried dynamic publishing (with swfobject)? It's really really easy.

Here's more info on dynamic publishing (http://code.google.com/p/swfobject/wiki/documentation) (see bottom of page).

gnaiz
04-08-2010, 06:38 PM
Thanks guys. I have gone through the documentation and it seems clear enough, I am still having trouble. I have even tried using the swfobject html generator. I think the problem I am having is with the param flashvars. I have to call an xml document. However, no matter what I try, whether with static or dynamic, I can't get the flash to load using those methods. Any specific ideas on how to deal with the flashvars? Do I need to change anything in the javascript?

UncleNinja
04-08-2010, 06:49 PM
No worries - the SWFObject documentation made me pretty frustrated too!

Look at the red parts:
<script type="text/javascript">

var flashvars = {};
flashvars.name1 = "hello";
flashvars.name2 = "world";
flashvars.name3 = "foobar";

swfobject.embedSWF("myContent.swf", "altContent", "300", "120", "9.0.0","expressInstall.swf", flashvars);

</script>Does that not work either? :)