Syncing separate swf files
I've been working on this problem for months, can'f find a viable solution. I can get the main movieclips of the files to p with a mouseover action, but I really开发者_StackOverflow中文版 need three separate swf files to sync upon load. Any suggestions?
To get multiple banners to sync your will have to use LocalConnection. When I have done this in the past I have used this setup:
- Decide on a master SWF. I prefer to use the heaviest file for this to reduce the amount of communication required.
- In your master SWF create a LocalConnection object for every SWF you intend to sync with.
- Each connection in the master starts to poll the slave SWFs, basically asking "are you there?"
- When a connection is established with all the slave SWFs it is safe to issue a command to each slave simultaneously to start them playing.
The main issue I have found with this is that your SWFs will very quickly fall out of sync. How quickly this happens depends on various factors, including the specs of the client machine, the browser and the complexity of your animation. Particular issues exist with inline video on the timeline. I have found the best approach with inline video is to stop it at spread intervals, and use the LocalConnection objects to confirm when each SWF has caught up before allowing all SWFs to continue playing.
If you require greater accuracy, you could maintain a constant communication over LocalConnection which allows the master to monitor the current frame of each slave SWF and trigger jumps on the timeline as slaves fall out of time.
精彩评论