views:

705

answers:

1

Hi

We feed JWplayer with an external playlist, and have an external button to shuffle this play list. I would like to move this button into the JWplayer control bar itself.

I'm not a developer, I'm a designer - but, thanks to a link found on the JWplayer support forum I have been able to add a custom button to the control bar - via the skin.

http://www.longtailvideo.com/support/forum/Skins/13043/Adding-custom-buttons-to-the-control-bar

However, I have a problem in getting the button to work. Speaking with the developer I need to provide an ExternalInterface function which will take the name of a javascript function (e.g. setShuffleFunction('window.toggleButton') ), and then call the javascript function with true/false (depending on the button state) when the button is clicked. I've spent hours looking in forums, and on Google and am unable to find an answer. Are you able to advise me? Thank you for your time.

kind regards, Rob Willie

A: 

It looks like you already have the Javascript function written. You can call your external javascript function with the flash.external.ExternalInterface;

eg.

function myButton_Click(e:MouseEvent)
{
    ExternalInterface.call("myJSFunction", true);
}

"myJSFunction" is your javascript function.

This page provides more explaination. http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html

David