PDA

View Full Version : Resolved Double java error maybe?



bluewalrus
12-10-2008, 05:35 AM
I posted this a while back in the HTML forum but got no luck. I was just looking over it again and threw some other forums and thought maybe its the java that's causing it cause there's two scripts hitting each other. I have multiple toggles and in each toggle there's some java that plays a flash movie (the jw player code). Right now only the top toggle works but it loads the last toggle's video for some reason except in Firefox. In Firefox this functions correctly. Which I thought was because Firefox was auto-correcting my HTML but i guess not. This is the page its on. http://www.bluewalrus.net/video.html
Hope you can see what I mean and maybe have a solution. Thanks for any ideas you can offer.

bluewalrus
12-13-2008, 05:30 AM
By no response here I'm going to assume no one has an idea to the problem and I should go on to recoding the page a different way?

jscheuer1
12-13-2008, 05:38 AM
If its java, you are in the wrong forum. This the javascript forum.

bluewalrus
12-13-2008, 06:16 PM
Oh...hmm I don't actually know which it is I have it placed as javascript in my document. I called it java here just short hand for javascript to type faster. I don't write java or javascript myself, I just find it and try and see if I can get it to work. These two java(scripts?) were working seperatley but then together the video part stopped. How can I tell if its java or javascript? Thanks.

jscheuer1
12-13-2008, 06:56 PM
OK, well one thing that's pretty obvious is that there are too many elements with the id of container. Only one element per page may have a given id. This is particularly important as concerns javascript. In FF it will just pick the first one. In IE it won't find any. I also notice that in IE 7, for some reason, the page never fully loads. So any script that depends upon an onload event will not initialize.

bluewalrus
12-13-2008, 08:48 PM
Okay, I fixed the div problem but still no luck. I made one mistake when changing it, I took out one of the container id's, the first one, and it played the last video in the second div aka the then first occurrence of id container. Don't know if this helps at all or not. I don't know where container is being tested to see if the flash player is installed or id change it there to a class. Do you think it as a class would do it or should it be 6 different ids? I don't know where to do this yet but it seems like the right direction. Thanks

jscheuer1
12-13-2008, 10:16 PM
Separate ids will be required if your code accesses these elements by their ids. Another good idea would be to use a unique variable name in each call to SWFObject.

And this isn't a valid Flash Object in IE:


<object type="application/x-shockwave-flash" data="blue.swf" width="950" height="120">
<param name="topbanner" value="blue.swf"/><param name="wmode" value="transparent" /></object>

That's probably why the page doesn't load in IE. You could use SWFObject to create the proper tags and/or, this code would work:


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="950" height="120">
<param name="movie" value="blue.swf"/>
<param name="wmode" value="transparent"/>
<param name="topbanner" value="blue.swf"/>
<!--[if IE]>
FAIL (Your Browser Doesn't support Flash 8) <a title="Flash Downloads" style="text-decoration:underline;" href="http://www.macromedia.com/go/getflashplayer">Get or upgrade the Flash Player</a>.
<![endif]-->
<!--[if !IE]> <-->
<object type="application/x-shockwave-flash" data="blue.swf" width="950" height="120">
<param name="topbanner" value="blue.swf"/><param name="wmode" value="transparent" />
FAIL (Your Browser Doesn't support Flash 8) <a title="Flash Downloads" style="text-decoration:underline;" href="http://www.macromedia.com/go/getflashplayer">Get or upgrade the Flash Player</a>.</object>
<!--> <![endif]-->
</object>

bluewalrus
12-14-2008, 04:16 AM
Okay I think i got it thanks. I changed these two lines in all the divs with different ids and added in the code you gave me to display the swf and it now seems to be working.

<div id="container6">
s1.write("container6");
</script>
</div>