There is also two example applications for this located in the samples that install with Flash: C:\Program Files\Macromedia\Flash 8\Samples and Tutorials\Samples\ActionScriptxternalAPI
Flash 6/7 For people targetting older flash versions (v6/7), there is the Flash / JavaScript Integration Kit. It uses some local connection trickery and XML to allow you to pass native objects such as Array, Boolean, Number, String etc between js and flash.
Geoff has actually written a special version of SWFObject which includes some integration between the intgration kit and SWFObject which removes some of the complexity of getting everthing working.