dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: communication between two of the same movies

  1. #1
    Official Shoe Shiner thehumanchimp's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    953

    communication between two of the same movies

    hey,
    Im kinda new to flash and i need to send data between two of the same movie running on different computers, as it is a game sending moves between the two players. In it, I would know the ip of the two computers if that would help. I saw something about LocalConnection on the macromedia site but it didnt really help. So, if anyone can help me, it would be greatly appreciated.
    Thanks,
    Nic

  2. #2
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    No, LocalConnection is used to send data between movies on the same computer. You need to use a server side scrip (php, asp, jsp...) to send data between different users (a bit slow, best suited for turn based games like chess) or Socket connection (fast, but you need to write a socket server or use a finished one, but not many webhotels let you run those...)

  3. #3
    Official Shoe Shiner thehumanchimp's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    953
    hey, thanks for ur reply.
    I'll need to use XML for the game to work properly however, after looking at the help thingy which comes with Flash, and copying, pasting and editing the examples in the help file, i always get a Connection failed message popping up...This is the code that ive got ath the moment:
    function myOnConnect(success) {
    if (success) {
    trace ("Connection succeeded!")
    } else {
    trace ("Connection failed!")
    }
    }
    socket = new XMLSocket()
    socket.onConnect = myOnConnect
    if (!socket.connect("ip address", 2000)) {
    trace ("Connection failed!")
    }
    So does neone know of, or could make an XML script which would be able to let me communicate between two of the same movies at the same URL but being run on different computers?
    Thanks in advance,
    Nic

  4. #4
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    For XMLSocket to work you need a socket server, which is basically a small program that listens on the port you have specified and sends back stuff to different clients, and it doesn't sound like you have one?

  5. #5
    Official Shoe Shiner thehumanchimp's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    953
    Does anyone know of a good XML socket server which comes with comes with instructions to help you set it up? cos ive searched the internet, found a few, but couldn't really get any of them to work.
    Thanks,
    Nic

  6. #6
    Official Shoe Shiner thehumanchimp's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    953
    ...and is it possible to use one of these XML socket things on free servers, like tripod.com, or anything else like that?
    Thanks
    Nic

  7. #7
    Member
    Join Date
    Aug 2003
    Location
    Dryden, ON - Canada
    Posts
    71
    Its highly unlikely that you will find a free webhost that will allow you to run such a program. Any type of server-based software can sometimes take up quite a bit of bandwidth, my host would allow me to set one up, but then again I pay a monthly cost and I also pay for bandwidth use over the allowed allocation per month. You would most likely have to pay for your webhosting as well to get such a thing. I use www.ultra-host.net if you want to check it out, you might be able to find a better one... who knows. Just a suggestion.

    As for the XML server, if you tell me what ports to listen on and what OS I can come up with something. I will also need a bit of know how on how XML exactly works with it's sockets to communicate because I've never done any XML work before. Email me at tyouk@sonicwave-studios.com with the details.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center