Click to See Complete Forum and Search --> : SWFObject broke upon copy and paste (odd)


WhiteDragon
10-07-2008, 10:23 AM
After copying and pasting the code from a page in which SWFobject was working perfectly, to another page my flash file does not load now, I've read up on the FAQ on SWFObjects page and reinstall Flash etc, nothing seems to work.

Driftek
10-07-2008, 10:26 AM
could you please post the code you are using.

Are the pages in the same directory? Did you create the object in the page? var so = new SWFObject("flashmovie.sqf", "mymovie", "800", "600", "8", "#ffffff");

FourCourtJester
10-07-2008, 10:46 AM
Umm ye, the SWFObject second parameter points to a div that will be populated with the flash info. Are you pointing to the right div?

Eye for Video
10-07-2008, 01:07 PM
Here’s a couple of things to check:
First, make sure you have the actual “swfobject.js” file in a location you can point to.
Second, make sure the path to that .js file is correct, such as this listed in <head>
<script type="text/javascript" src="scripts/swfobject.js"></script>
Third, you can paste in the typical code for calling the swfobject into the html page, something like:
<div id="top_banner">
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("images/logo_animation.swf", "logo_animation", "960", "170", "8", "#4796d2");
so.write("top_banner");
// ]]>
</script>
</div>Just copying and pasting the code listed in the third step won’t work without doing the first two.
Eye for Video
www.cidigitalmedia.com

WhiteDragon
10-07-2008, 07:03 PM
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550" height="505">
<param name="movie" value="flashmovie.swf" />
<param name="wmode" value="window" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="flashmovie.swf" width="550" height="505">
<param name="wmode" value="transparent" />
<!--<![endif]-->
<p>Flash not found!</p>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>

All within a <div> and the script is in the code so that is taken care of already.

Eye for Video
10-07-2008, 07:46 PM
Sorry but I thought you were talking about swfobject, but how does any of the code shown above relate to swfobject?
What's shown above looks more like just an <object>. Did you try the steps and code I posted?
EfV

WhiteDragon
10-07-2008, 08:22 PM
That is SWFObject, it worked on another site I did and now it doesn't work that is odd. That code is from the SWFObject manuals.
I tried the code you posted, it didn't work. Take a look at the SWFObject manuals you'll see a exact replica of the code I was using and it worked, now it doesn't that is odd.

Maybe someone else could shed some light on this.

Eye for Video
10-07-2008, 09:21 PM
What I’m seeing in your code is not the swfobject. swfobject is an actual javascript file (swfobject.js), which must be pointed to from the html page, such as:
<script type="text/javascript" src="scripts/swfobject.js"></script>
and then called from the position where the .swf will be placed on the page. You must have the .js file and you must call that from the html page. Just putting some code on the html page, even if it is the correct code, will not work. All three steps I mentioned earlier are required to get swfobject to work.
Get the javascript file here:
http://www.adobe.com/devnet/flash/articles/swfobject.html
A second good feature of the swfobject is that you can use alternate content (content which the viewer will see if they don’t have Flash). This can be regular html text. This allows you to provide descriptions about the .swf or videos which might otherwise might not be indexed by robots and spiders.
For example, view the source on this page, it will show the swfobject and also the alternate content (scroll down to that section).
http://www.cidigitalmedia.com/video.html
You will see the <object> code, as you have listed above, commented out. The whole purpose of the swfobject is to replace <object>. Then notice all the alternate content:
<!-- Alternate content -->
Video interviews and highlights from the Sequim Irrigation Festival. Videos were created for the Sequim Shiso City, Sister City Association.<br />
Video Sequim Mayor Laura Dubois greets Mitsunori Namba, Consul General of Japan.<br />
Video interviews with Sequim students prior to the Irrigation Festival Parade. They will be traveling to Japan this fall.<br />………..
A good test of your implementaion of swfobject is whether or not the alternate content will show during testing, not just the .swf.
I support the use of .swfobject and encourage the use of alternate content.
Best wishes,
EfV

WhiteDragon
10-07-2008, 10:01 PM
I have the JS in the <head> of the page which I forgot to mention. And dispite that I have the javascript in the <head> of the page it's still not working.

Eye for Video
10-07-2008, 10:49 PM
Do you have the actual javascript file, swfobject.js? And is the path in the <head> correctly pointing to the javascript file? Without the actual .js file, all the code simply will not work.
In case you are wondering, it starts out like this:
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();..............
It's over 130 lines long..
EfV

WhiteDragon
10-07-2008, 10:49 PM
I've tried all the tests, and installed and uninstalled flash, nothing works. It is not working.
Yeah I have SWFObject v2.1, installed on the server. Nothing is working in any browser.

Eye for Video
10-07-2008, 10:57 PM
But do you have a javascript file called swfobject.js?
EfV

WhiteDragon
10-07-2008, 11:11 PM
yup I do.

Eye for Video
10-07-2008, 11:17 PM
I just downloaded the v2.1 from
http://code.google.com/p/swfobject/
and unzipped. Then I open the "index.html". Can you do that and does it work for that page?
EfV

WhiteDragon
10-07-2008, 11:24 PM
Alright it's late will resume tommorrow but their is a update:

Locally it works in FF3
Locally it doesn't work in all versions of IE

Online it does not work in any browser.

Eye for Video
10-07-2008, 11:29 PM
Well till you figure it out, here is an older version which will work with the code I posted above.
EfV

WhiteDragon
10-08-2008, 01:23 PM
Nope, not even that worked. I don't know what is going on.

Eye for Video
10-08-2008, 02:37 PM
Well that's got me beat, sorry I couldn't help.
EfV

WhiteDragon
10-08-2008, 02:57 PM
No you did your best, and I appreciate it. It is very odd and I hope to have it solved ASAP.

WhiteDragon
10-09-2008, 10:10 PM
Eye for Video: I got SWFObject working in FireFox 3 but not in IE7/6 it loads very slow in IE. I'm not even sure if it works after loading in IE.

Eye for Video
10-09-2008, 10:47 PM
Glad to hear that!
So is that version 2.1? What did you change?
I'm used to using an older version and your code looks so similar to a regular <object> that the new version confused me. How can you tell the difference between using a regular <object><embed> method and the new swfobject? Can you still use alt content?
EfV

WhiteDragon
10-09-2008, 11:04 PM
Honestly I didn't really do anything much as all. I looked over some code and cut and pasted and checked over some settings.

There still is a problem as IE (all versions) does not load I've gotten a few to try and it just never loads. That is what I don't know how to solve.