.swf in Wordpress
- Started
- Last post
- 12 Responses
- Andrew_D
Hi, I'm trying to embed a .swf into the index.php of Wordpress and it ain't showing up. Here's my code:
<?php get_header(); ?>
<script type="text/javascript" src="swfobject/swfobject.js"></script>
<br />
<div id="videocontainer">
<div id="deckcontainer">
<br />
<a href="/master_deck.zip"><img src="<?php bloginfo('template_url'); ?>/images/master_deck.jpg"></a>
<div id="deckCopy">
<h2>SHOPPER STUDY</h2>
<hr>
<p>Find sales statistics for regions worldwide, discover consumer insights and learn all there is to know about the shopper decision-making process</p>
<hr>
<a href=""><img style="margin: 20px 0px 0px 10px;" src="<?php bloginfo('template_url'); ?>/images/download_button.jpg"></a>
</div>
</div>
<div id="content">
<p>In order to view this page you need JavaScript and Flash Player 8+ support!</p><script type="text/javascript">
// <![CDATA[ var so = new SWFObject("video_player.swf", "video_player", "600", "370", "8", "#000000"); so.addParam("scale", "noscale"); so.addParam("salign", "left"); if( so.write("content") ) { var forcesize = new SWFForceSize( so, 600, 370 ); } // ]]>
</script>
</div>
</div><!-- closes videocontainer -->
<br />
<?php if (have_posts()) : ?>Something isn't jiving. Any ideas? Many, many, many thanks in advance. Google has come up with plugin's, but I want it hard coded into the page.
Cheers.
- foobaz0
Are you getting a javascript error? The only thing I can think of off the top of my head is the path to your SWObject js file isn't right maybe...
Try
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>swfobject/swfobject.js"></script>
- acescence0
a. take that cdata crap out of there and see if it works
b. swfforcesize is a separate script from swfobject, have you included that script?
- acescence0
oh yeah, and the leading // is commenting out that line
- foobaz0
^ nice. That would do it for sure.
- Andrew_D0
Thanks, peeps! Going to give these a shot. I've been staring at this for so long type of thing.
- Andrew_D0
Still not working, and when I add
<?php echo get_template_directory_uri(); ?> to the script type, the body doesn't show up.
I'm looking like this now:
<script type="text/javascript" src="swfobject/swfobject.js"></script>
<script type="text/javascript" src="swfobject/swfforcesize.js"></script>
<br />
<div id="videocontainer">
<div id="deckcontainer">
<br />
<a href="/master_deck.zip"><img src="<?php bloginfo('template_url'); ?>/images/master_deck.jpg"></a>
<div id="deckCopy">
<h2>SHOPPER STUDY</h2>
<hr>
<p>Find sales statistics for regions worldwide, discover consumer insights and learn all there is to know about the shopper decision-making process</p>
<hr>
<a href=""><img style="margin: 20px 0px 0px 10px;" src="<?php bloginfo('template_url'); ?>/images/download_button.jpg"></a>
</div>
</div>
<div id="content">
<p>In order to view this page you need JavaScript and Flash Player 8+ support!</p><script type="text/javascript">
var so = new SWFObject("video_player.swf", "video_player", "600", "370", "8", "#000000");
so.addParam("scale", "noscale");
so.addParam("salign", "left");
if( so.write("content") )
{
var forcesize = new SWFForceSize( so, 600, 370 );
}
</script>
</div>
</div>This would seem correct to me, but it ain't working. :-(
- acescence0
in firefox, tools > error console will show you javascript errors.
also, safari has an error console under prefs > advanced > show develop menu in menu bar, then look in develop menu.
also in safari, window > activity shows all of the files that a page is requesting and which it can't find as well as the absolute path to where it's looking
- airey0
use one of the many swf plugins available in wordpress to place the sucker and save yourself some headache.
- zaq0
<?php wp_swfobject_echo("movie.swf", "width", "heigth"); ?>
- Andrew_D0
Thanks one last time, QBN'ers. I just had to put the path in the src= java script.