views:

233

answers:

3

Ok, i have asked something similar before, but never go to the solution i need. So am starting a new stack to not confuse my issues, and to make a little clearer.

What i need to do

I have multiple flash objects on a html page, they are all identical, and all of them need to be sync'd with the correct time. In its current state, each one querys the timeserver, and gets the time, which works great. BUT what i want to achieve is the first one to load to be the only one that sync's with the time server, and then the other flash objects wait for it to finish, and load the sync time from that one.

The Problem

SharedObjects: On paper, this seamed like the perfect solution, i get the 1st one to load to save a SO "timestarted", if any loading flash after that sees this SO, it waits for a "synctime" SO to be created, and load that...great! But no... SharedObjects only appear to load the SO at the time of loading the flash, any changes, or new SO after the flash loads is completely unknow to anyother flash then the one that created it! (until the flash is reloaded)...doh

LocalConnection: A little more complicated, but sounded like a good solution, apart from only one flash can have the connection open at any one time, gah!

What i need

In simple terms i need a way to have one flash object declare themself as the sync'er, and the others to listen up! Something i thought would be so simple, but turing out to be so complicated. I need any suggestions, advice on what to do.

Many Thanks in advanced

(p.s sorry for the unpleasing wall of text :D)

+2  A: 

If you can use a tiny bit of javascript you can do this using ExternalInterface. Have the movies call out to a small js-script that keeps track of whoever is loading the time, then have the other flashes just register callbacks. Once the first flash has the time, call out to the js and let that update the other two.

grapefrukt
A: 

I think what you are really looking for is the LocalConnection object https://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/

It'll allow your swf's to talk to each other.

Tyler Egeto
A: 
pythagoras