RTMP server is nothing more than a media server for distribution of live and on-demand content. These servers are independent and have their own modules.
There are several software on the market, but the most used are:
Wowza Media Server: http://www.wowza.com/ (paid)
Adobe Media Server: http://www.adobe.com/br/products/adobe-media-server-family.html (paid)
And the free Red5.
If you want to have an RTMP server to offer this service to third parties, you need to have a good server, joining good data processing and network. Depending on your needs, you can use a server outside the country so you can reduce costs and have a great infrastructure.
There are many offers for this type of service in the market, where all the infrastructure is in charge of the hosting company and you would only try to make the transmission.
Search Google for Video Streaming and analyze offers paying attention to value and number of concurrent users.
As for your code, it would look like this:
var nc:NetConnection = new NetConnection();
// Na linha abaixo é feita a requisição para o servidor
nc.connect("rtmp://ip-ou-host-do-servidor:1935/live/live");
var myRemoteSO:SharedObject = SharedObject.getRemote("mo", nc.uri, false);
myRemoteSO.connect(nc);
For this to work, you would need to be sending data to the server, using programs like Adobe Flash Live Encoder : http://www.adobe.com/br/products/flash-media-encoder.html
Follow the Wowza Media Server documentation so you can clarify your doubts:
http://www.wowza.com/forums/content.php?217-Quick-Start-Guide
There are still public services at no cost, but with reduced service quality. Below are some of them:
http://www.zstream.eu/
http://livestreamcast.org/
http://www.justin.tv/
http://new.livestream.com/
http://www.ustream.tv/
http://www.livecast.com/
http://www.google.com/+/learnmore/hangouts/onair.html