For this I will be using flash 8. I'm assuming you have some knowledge of flash. This is not a copy and paste and get a fully working game kinda of tutorial...
First you will need a server to connect too.
Palabre
XML Socket Python Server
Freehttp://palabre.gavroche.net
Mostrey
Flash / Python Socket Server
Free
http://mostrey.be
Flash Now
Flash Socket Server
Free (5 User) $495 (Unlimited)
http://www.nowcentral.com
Electro Server
Flash/Lingo Socket Server
Free (25 Users) $700 - $4400 (500- 200 000 Users)
http://www.electro-server.com
Smartfox
Flash Socket Server
Free (20 Users) $500 - $2000 (100-Unlimited)
http://www.smartfoxserver.com
Oregano
Flash Socket Server
Free
http://www.spicefactory.org/oregano/
Any of those servers will work nicely.
**Warning Each Servers Connection and Reply Codes Is Different. This is only a basic idea**
First you need to give the frame some actionscript so it can connect to the server.
To do that you would use something like this:
Next you would need a login for your user's to login to your game obviously.Code:mySocket = new XMLSocket() mySocket.connect("ip", port) stop(); mySocket.onConnect = function(success) { if (success) gotoandstop("Scene 1", 2) }
You need 2 fields. Call 1 username and the other password. Then you need a button for submit..
The the submit button would have a code to send to the server//
The server will reply with a code saying if it's valid or not and if the user has special privalages or not.Code:on (Press) { mySocket.send("setname " + username + " " + password + " 0 0") }
You need to tell the client what to do if the user is valid.
You would use something like this:
This just goes to the frame with your chat in it if the user exists.Code:if (packets[0] == "auth_ok") { gotoandstop("Scene 1", 3) }
Next you will need a chat bar..
Make 1 input text field and another submit button.
set the var of the input text field as chat.
Then to send the chat to the server so everyone can see it. You would do something like this:
I'll add more later I'm have to work soon. Maybe I'll add pictures too if people want.Code:on (press) { mySocket.send("speak " + chat) chat = "" }






Reply With Quote