Basically I created a simple mp3 player, and there are multiple copies of that embedded in a page. Now when I play one, I want all the others to pause…..any idea how to do this? is it possible to do n-way localconnection? or is there a better alternative?
Share
ExternalInterface.call can be used to call JavaScript from a SWF and, vice-versa, ExternalInterface.addCallback can be used to expose certain methods to be called by JavaScript.
For example, in each SWF, you might have:
And then in the JS that is part of the HTML containing the SWF:
Depending on security settings/domain placement, you may need the following:
In HTML:
In SWF:
See: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html#addCallback%28%29