More LocalConnection issue

Hello,

I am having a problem with establishing more LocalConnection-s on the same system. My problem is :

I have a video player that communicates with another flash movie, a graph that is synchronized with the video player (video player sends info, the graph receives it). These are two different flash movies, so I’m using localConnection to communicate between them.

The problem is, that if I start another instance of these two ( i.e. start another video player and another graph ), the second video player will only (obviously) send signals to the first graph. I need to be able to start more instances without this interference, so the solutions I chose (didn’t manage to make any of these work yet) were:

  1. I added to the LocalConnection’s name a unique ID ( I called it channel ). e.g. : connection0, connection1 etc, and made sure that no other video player and graph viewer that are already running are using these ID. The problem with this method was that the video player had to send signals through LocalConnection, letting other video players know that it’s ID is taken, and like this the communication between the video player and the graph viewer was slowed and didn’t work well any more.

  2. I added to the localConnection’s name the current time ( in the format ss:int(ms/100) , that is, I am using only the most significant digit of the millisecond - the hundreds digit ). Because the 3 movies could’ve read the time in different moments, I checked three channels, and saw which was the one used by the video player : ss:int(ms/100)-1, ss:int(ms/100), ss:int(ms/100)+1 (i.e. I added to (ms/100) -1, 0 and 1). I don’t know why yet, but this method didn’t work either.

The solution I think could work is by changing this last solution, but I don’t know how to do that : a JavaScript function could read the time, store it in a variable, this function would be called by the video player when it starts. Then, another JavaScript function would return the variable ( the time the other function read ), and this function would be called by both the video player and the graph. The problem is that I don’t know JavaScript, and I don’t know how to send the returned value of a JavaScript function to the flash code. I would appreciate if anyone could help me.