This is technically possible, but I am guessing that it will not be possible in an environment for ads.
With most ads, each one is served in its own
<iframe> that is on a separate domain than the ads themselves. Communication between iframes is done via
postMessage calls, but these will typically not work across domains unless there are certain sandbox exceptions, which are unlikely to be made for ad iframes.
I have a solution here if you are able to specify
sandbox="allow-same-origin allow-scripts" on the ad iframes:
SyncedAds.zip (338.6 KB)
It works by having a script on the On Scene Load handler that sends out a message telling other iframes it is ready. One will load first which will have complete knowledge of who is ready; when it detects all of them are then it will signal its siblings to start an animation.
(Note that the
sendMessageToSiblings() inner function is quite dumb and probably not good enough for ad production uses.)
The only difference in the scripts between the three ad files is the first line which specifies an identifier:
var myIdentifier = "ad2"; // change on each ad
This corresponds to items in a list that it knows it will need to complete:
var allIdentifiers = ["ad1", "ad2", "ad3"];
If the ads are not being placed as iframes, then this would become much easier. But I'm guessing it is in an iframe where you won't have the security ability to do this.
I imagine Flash could do it because
ExternalInterface.call() seemed to talk to the flash plugin which had knowledge of all ad instances and didn't have to deal with current browser security issues.