Post Archive

› June 6, 2004

Plug-in support on the Mac

  • Reported by liorean
Liveconnect is the Netscape technology that allows JavaScript and Java or plug-ins using the Netscape Plug-In Architechture to communicate, both ways. Since Netscape Communicator 4 waned from the userbase, the Mac platform has been largely missing liveconnect support, Mozilla and derivates being the only browsers supporting it. Recent browser development has given us this feature back, however. Safari now supports Java-JavaScript communication through liveconnect, and Opera have restored liveconnect support in 7.51. It's not complete, but we're getting there - soon this capability, which has never been missing on the Windows platform, will be back on the Mac platform. Why is this good for the Mac platform? Well, for a number of reasons. One of them would be that as plug-in support increases, Mac users can use a larger part of the web. Another is that this increased plug-in support can be used as an argument to get users to move to more standards compliant modern browsers from the old and good but buggy and aged, Internet Explorer : Mac.

Comments

1. June 7, 2004 04:19 PM

Quote this comment

John Dowdell Posted…

Hmm, when I check Apple's docs they say their new browser with new Java VM now offers JavaScript/Java intercomunication, and doesn't yet talk with plugins. When I search Opera's site with term "liveconnect" I get some older material but can't readily find a technical document. By chance, do you have any specific URLs that would be useful for study...?

(For browser/plugin intercommunication in general, I haven't seen too many people try to use it, at least after the first phase of experimentation was over... QuickTime and RealPlayer are good candidates for it because their interactivity is handled externally and so they need some communication mechanism... IE/Win is, as always, integrated instead at the system-level and people in that one environment can talk among themselves... I'm getting off-topic, but from what I've seen browser/plugin communication never really took off, as attractive as it seemed initially.)

Regards,
John Dowdell
Macromedia Support

2. June 7, 2004 04:53 PM

Quote this comment

liorean Posted…

Correct, Safari doesn't support Plug-In/JavaScript communication yet, only Java/JavaScript communication in the current version. I maybe should have made that clear in the original post. As for the Opera liveconnect support, you should point your browser at the Opera 7.51 for Mac Changelog, which states that it has added Initial support for Liveconnect (No, nothing more than that, I'm afraid...). If you want more information on that, it might be a good idea to contact the Opera personell working with it. You could try contacting Eirik Stavem. However, for more general information the Opera forums might be a good place to ask...

3. June 8, 2004 02:14 PM

Quote this comment

Shaun Inman Posted…

If your main concern is communicating from Flash to JavaScript (one-way) you can always use Flash's getURL() method and the javascript: protocol to call predefined functions in the HTML like so:

_root.getURL('javascript:my_func()');

And the following is defined in your HTML:

function my_func() { alert('Do something here!'); }

It's a kludge and as far as I know it's only one-way but if that's all you need then...

4. August 13, 2004 05:56 PM

Quote this comment

Seth Posted…

Just an update: you can't "always" use Flash's getURL method. I'm running into problems because I have flash in an iframe in a domain other than that of the parent window... so the cross domain scripting error gets thrown if you try to call getURL javascript, since flash is in a different domain than the parent window... my fscommands work, however, but I'm searching for a good way to detect if they have the ability for an FScommand. If they don't, I want to give them a popupwindow (which will be in my domain to enable javascript commands)... this is the biggest headache I have when working with flash, by FAR.

5. September 2, 2004 06:57 PM

Quote this comment

chichilatté Posted…

As said above, you can use the flash function getURL("javascript:yourFunction()") to send info from Flash to Javascript, but you can send data the other way too, using the flashVars parameter in the embed tag of the javascript. Course, the data can only be passed at load time, but not bad anyway. I have heard there may be some problems with safari (1.2 and below so far) in that it only accepts the first variable in the flashVars string, but at least it does that.

TOTALLY USEFUL TIP: what i often do when i want to send lots of info into flash (from php) is use a handy thing called Serializer, where you can turn any php object into a string using the built-in serialize() function, send it to flash where flash unserializes it back into an object. the object can contain anything you like: arrays, more objects, strings etc. Really handy if you don't want to turn your brain to mush converting complex data structures into url strings and back again.
sephiroth's actionscript SerializerClass

What i want to know is why moock and macromedia both say fscommand works on mac with liveConnect, Netscape6.2+, Flash6r40+, when it clearly doesn't!
macromedia fscommand browser support matrix
moock fscommand page