1 Reply Latest reply on Apr 10, 2007 6:13 AM by dummyboo

    Sharing 1 XMLSocket Between Movies

    TwiceAlive100
      I'm working on a project that requires me to use XMLSockets across multiple movies. I have the XMLSocket working fine for each movie, but it would be much better if I could share one XMLSocket across each movie to avoid creating multiple connections.

      So far, I've tried creating a LocalConnection between two movies and passing the XMLSocket over the LocalConnection, but that has not worked. I can pass just about anything over the LocalConnection successfully, but anytime I pass the XMLSocket, the receiving movie only receives a null value. I could simply pass any XML data over the LocalConnection, but that does not really fit what I am trying to do.

      Here's a basic overview:
      I have two movies that both need a persistent connection to the server. At any time, either movie can be closed, i.e. one movie cannot depend on the other to always be able to provide the connection. So whichever movie creates the connection first should share this connection with the second movie. This sharing can either be as both movies are open, or simply passing the XMLSocket to the other movie whenever one movie closes. The basic question is this: is there a way to pass an XMLSocket object from one flash movie to another?

      Thanks in advance,
      TwiceAlive100