A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Sockets! Awesome! Wait...why is the ball flickering!?!?!?!?

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    3

    Sockets! Awesome! Wait...why is the ball flickering!?!?!?!?

    Project Files

    I made a client and server app in Flash Pro CS5 to get a basic understanding of sockets. After getting the sockets working, I noticed the ball in the client program was flickering...have no idea why.

    The server tracks the X and Y coordinates of the mouse, and then transmits those coordinates to the client. The client then moves the ball to those transmitted coordinates, allowing the server to move the ball in the client via mouse position.

    Note: The client can be run either as a Flash movie or as an AIR application, where the server MUST be run as an AIR application. Also, both applications MUST be run in the flash debug environment since I have not yet implemented security policies.

  2. #2
    Junior Member
    Join Date
    Oct 2010
    Posts
    3
    SOLUTION:

    Found the solution the day I posted this, so the least I could do is provide an answer...

    Rather than changing the X and Y coordinates of the ball rapidly at the pace that the coordinates are received by the socket, simply have the X and Y coordinates update in each frame, but ONLY apply the received coordinates to the ball when the ball's ENTER_FRAME event is sent.

    Cheers!

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