Hi everyone,
I'm currently developing another Twitter WordPress plugin using Flash
and (hopefully) SWFObject. However, I'm having a heck of a time
getting SWFObject to do anything. I've used it many times in the past
and I don't ever recall having this kind of issue with it.
Here are the specifics:
SWFObject version 2.0 (new install so using all the latest files)
FireFox 3 as my test browser (SWFObject on other sites works just
fine!)
WordPress 2.8.5 (if it makes any difference)
SWFObject is loaded into a DIV (it's part of a sidebar widget)
Here's the embedding code, adapted directly from the deconcept's site:
<script type="text/javascript" src="/wp-content/plugins/
swfobject.js"></script>
<div id="flashcontent"></div>
<script type="text/javascript">
var so = new
SWFObject("/wp-content/plugins/tweetness.swf",
"tweetnessWidget", "375", "120", "10", "#FFFFFF");
so.write("flashcontent");
</script>
This is copied from the source window in FireFox (i.e. PHP/WordPress/
etc. are not mangling it before returning it).
I'm using Fiddler web-debugging proxy to watch the individual HTTP
transactions, and FireFox's error console for problems with
JavaScript.
When I try the above example, the JavaScript error console reports
that "SWFObject is not defined". I have verified that the swfobject.js
file is *definitely* loading from the location specified (can see it
in, and the full source code, in Fiddler). I've also verified that the
"tweetness.swf" file is located in the same directory, permissions set
to 777 (at least for testing purposes), and I can load the SWF file
directly in the browser.
I've tried moving the DIV tag around to see if that makes any
difference:
<div id="flashcontent">
<script type="text/javascript" src="/wp-content/plugins/
swfobject.js"></script>
<script type="text/javascript">
var so = new
SWFObject("/wp-content/plugins/tweetness.swf",
"tweetnessWidget", "375", "120", "10", "#FFFFFF");
so.write("flashcontent");
</script>
</div>
<div id="flashcontent"></div>
<script type="text/javascript" src="/wp-content/plugins/
swfobject.js"></script>
<script type="text/javascript">
var so = new
SWFObject("/wp-content/plugins/tweetness.swf",
"tweetnessWidget", "375", "120", "10", "#FFFFFF");
so.write("flashcontent");
</script>
<script type="text/javascript" src="/wp-content/plugins/
swfobject.js"></script>
<script type="text/javascript">
var so = new
SWFObject("/wp-content/plugins/tweetness.swf",
"tweetnessWidget", "375", "120", "10", "#FFFFFF");
so.write("flashcontent");
</script>
<div id="flashcontent"></div>
In all three cases the swfobject.js file loads correctly and the
error in the FireFox error console is no longer there (no errors, in
fact). However, no Flash content appears and based on what Fiddler
reports, no attempt is made to load it (no 404 errors, etc.)
As a final solution, I thought there may be some issue with XHTML and
special characters, so I used comments for inline JS code:
<script type="text/javascript" src="/wp-content/plugins/
swfobject.js"></script>
<div id="flashcontent"></div>
<script type="text/javascript">
<!--
var so = new SWFObject("/wp-content/plugins/tweetness.swf",
"tweetnessWidget", "375", "120", "10", "#FFFFFF");
so.write("flashcontent");
-->
</script>
<script type="text/javascript" src="/wp-content/plugins/
swfobject.js"></script>
<div id="flashcontent"></div>
<script type="text/javascript">
/*<!-- */
var so = new SWFObject("/wp-content/plugins/tweetness.swf",
"tweetnessWidget", "375", "120", "10", "#FFFFFF");
so.write("flashcontent");
/*-->*/
</script>
And I used this comment technique with the variations I
mentioned
above (moving the DIV tag). As before, I either get a "SWFObject not
defined" error, or the script simply seems to do nothing (no request
is made for the SWF file, no errors are displayed).
One thing I noticed is that something in the SWFObject function
must be causing the problem because if I put something simple, like an
alert, before the function, I can see the alert. If I put it after the
SWFObject declaration, however, it's not executed. Again, though, the
error console shows no problems :(
Would anyone have any ideas? I'm willing to try them all!
Cheers!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---