PDA

View Full Version : Netscape 6.1 JS Problem


sir sixx
09-24-2002, 11:56 AM
I'm having a problem with some JS that I have on my HTML page that controls a Flash movie.

It works fine in IE but not in Netscape 6.1
This is the code within the head

<script language="JavaScript">
function GotoFrame(frameNumber) {
document.pcb.GotoFrame(frameNumber);
}
</script>


and this is the code in the body

<BODY onLoad="GotoFrame(37)" bgcolor="#666699" leftmargin="0" topmargin="0">


Should this work in Netscape or is this IE only JS?
How do I get it to work in Netscape?

Help me please... Thanks

jkd
09-24-2002, 11:58 AM
I don't believe Macromedia released a scriptable Flash plugin for Gecko until only recently. Go grab Netscape 7 or Mozilla 1.0.1 or 1.1.

sir sixx
09-24-2002, 12:02 PM
Wow that was quick!!

So does that mean that it won't work for anyone visiting the site using Netscape 6.1 ?

Is there no other way around it?

This is a business web site so it has to be accessible to all.

jkd
09-24-2002, 12:18 PM
Originally posted by sir sixx
This is a business web site so it has to be accessible to all.

Then don't use Flash. That's all I can really say about that.

Blame Macromedia for not releasing a scriptable plugin earlier, but they were probably waiting for the frozen API that came with Moz 1.0.

sir sixx
09-24-2002, 12:30 PM
I understand your point, but for speed and content nothing comes close to Flash.

It seems that as surfers and designers we are stuck between the devil and the deep blue sea.
IE 6 has some many bugs its almost unusable and Netscape is not properly supported by anyone.

What chance do we stand of creating nice looking, fast, reliable web sites?

Thanks for the advice.

sir sixx
09-24-2002, 02:50 PM
Okay,

I've spoken to the client and they are not too worried about the site only working with Netscape 7. However, I still can't get it to work with 7. 7 doesn't see it as an error but it will not action the function, so I'm even more confused than I was before!!

Any ideas?

jkd
09-24-2002, 04:31 PM
http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&oe=UTF-8&th=71a0e44787a7c294&seekm=ahgfbr%247f71%40ripley.netscape.com&frame=off

Are you using <embed>? Because it is deprecated I believe.... use <object> tags instead. Post some source so we can see some more. :)

sir sixx
09-24-2002, 04:41 PM
The what on the what what ?

I'm sorry you'll have to speak slower I'm not really into JS at all.

All of the code I have used is in my first post above.

jkd
09-24-2002, 05:06 PM
Originally posted by sir sixx
All of the code I have used is in my first post above.

How are you embedding the Flash into the page? Through an <embed>, or through an <object>?

We need to see that part of the code.

ahosang
09-24-2002, 11:45 PM
In any case(regardless of plugins or embed tags), this code doesn't look right:
function GotoFrame(frameNumber) {
document.pcb.GotoFrame(frameNumber);
}

should be :

function GotoFrame(frameNumber) {
document.getElementById("pcb").GotoFrame(frameNumber);
}

That identifies the element in Netscape(so syntax is at least correct).

sir sixx
09-25-2002, 09:02 AM
Right,

I've done that, it works within I.E. but still will not work in N7.
I read the google post and did as it said and the Ford web site works fine for me.
I can't help but feel that N7 is not sending the information to Flash. What I don't know is whether this is the Flash plugin or my script.

If you guys think that the script looks like it should work the maybe the next step for me is to speak to Macromedia and see what they say.

Thanks for your help with this.

Sir Sixx

sir sixx
09-26-2002, 04:02 PM
I was checking that I had done everything and I realised that a question had been asked about <embed> or <object> tags and I had not answered... sorry jkd

So here is all of the code from my html page except for the meta tags

<script language="JavaScript">
// This is only needed for Netscape browsers.
function flashGetHref() { return location.href; }
function flashPutHref(href) { location.href = href; }
function flashGetTitle() { return document.title; }
function flashPutTitle(title) { document.title = title; }
</script>
<script language="JavaScript">
function GotoFrame(frameNumber) {document.getElementById("jstest").GotoFrame(frameNumber); }
</script>
</HEAD>
<BODY onload="javascript:GotoFrame(6)" bgcolor="#666699" leftmargin="0" topmargin="0">
<OBJECT classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="760" HEIGHT="405" id="jstest" ALIGN="">
<PARAM NAME=movie VALUE="jstest.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#666699>
<EMBED src="jstest.swf" loop=false quality=high bgcolor=#666699 WIDTH="760" HEIGHT="405" ALIGN=""
LiveConnect=true TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
</BODY>

When I run this with the javascript console i get this error from it:
{document.getElementById("jstest").GotoFrame(frameNumber); } is not a function.

What does that mean?

jkd
09-26-2002, 07:40 PM
var obj = document.getElementById('jstest');'
var str = '';
for (var i in obj) str += 'object.' + i + ' = ' + obj[i] + '\n';

alert(str);


In NS7, methods of builtin and user-defined objects are enumerable, therefore I would assume (I've never tested it in this case) that available methods from Flash would also show up. So everything that shows up in that alert will be the available properties and methods by the DOM and by Flash. The alert actually will end up being pretty huge, and probably overflowing... you may want to document.body.innerHTML += 'object.' + i + ' = ' + obj[i] + '<br/>; instead of doing it in an alert.

sir sixx
09-27-2002, 09:54 AM
I'm sorry jkd, I have no idea what your telling me there.

Not a clue.

Sorry

jkd
09-27-2002, 11:33 AM
I'm telling you to dump all available methods of that node to see if the Flash ones are exposed.