Basics of P2P in Flash
May 31st, 2009
This videotutorial explains the basics of working with P2P (peer to peer) in Flash Player 10.
I made this tutorial with focus on simplicity of this fantastic feature of Flash. There are bunch of articles and examples in the world showing how to create your own P2P app, but most of them are very complex or hard to catch.
In this tutorial you’ll get idea how to connect two different peers and exchange data between them with ActionScript 3.0 and Flex only.
Prerequsites:
- familiarity with ActionScript 3 and Flex Framework
- Flash Player 10 Debug version installed download
- Flex Framework 3.3+ download
Videotutorial: http://flashrealtime.com/tuts/p2p-in-flash.html (20 min.)
Try: P2P demo (run in two browsers, explained in video)
Source: download P2P.mxml.zip
Note: Programatically the main P2P logic is not to connect peers together just via NetConnection, but by defining peerIDs to NetStream.
PS: don’t forget to change your Flex Compiler settings to use Flash Player 10
Btw: nice P2P Mill Game done by my friend Pavel Šimek http://nestor.cz/mill/
Good Luck!



