and why i need to use phpamf in such application ?
best regards.
--
View this message in context: http://old.nabble.com/how-to-build-a-full-chat-web-application-like-paltalk.com-based-on-red5--tp31417469p31425941.html
-Chris
On Apr 18, 2011, at 2:38 PM, alrazy wrote:
>
>
> i have this book but the example doesnt include a good chat example , its
> very basic beside that i dont see any java code there !!?
> does that mean i dont need any java knowledge to build my own chat rooms app
> and its just a client matter that maybe will need to connect to phpamf for
> user registration or login and managing the chat rooms for users and admins
> prespectives ?
>
>
> --
> View this message in context: http://old.nabble.com/how-to-build-a-full-chat-web-application-like-paltalk.com-based-on-red5--tp31417469p31426628.html
i have this book but the example doesnt include a good chat example , its
very basic beside that i dont see any java code there !!?
does that mean i dont need any java knowledge to build my own chat rooms app
and its just a client matter that maybe will need to connect to phpamf for
user registration or login and managing the chat rooms for users and admins
prespectives ?
--
View this message in context: http://old.nabble.com/how-to-build-a-full-chat-web-application-like-paltalk.com-based-on-red5--tp31417469p31426628.html
In SoSend, So means SharedObject, and Send refers to the method in which
you’ll send and receive
messages from the Red5 server. This is different from the simple chat client
that uses SharedObjects
and simply changes a property on the SharedObject to push a new message to
the clients (see the
earlier SimpleBall sample). This demo sends and receives messages from Red5
and other users by calling
a method on the server side via SharedObject.
Confused? Let’s take a look at the code; it’s really pretty straightforward:
my question : the following code is just actionscript/flex client or its a
java server side code ??!!
import mx.utils.Delegate;
// create basic netConnection object
var nc:NetConnection = new NetConnection();
// connect to the local Red5 server
nc.connect("rtmp://localhost/oflaDemo");
// create StoredObject - pass the name of the shared object,
// the netConnection URI ("rtmp://localhost/oflaDemo"),
// and whether or not it's persistent
var so:SharedObject = SharedObject.getRemoteå
("simpleChatDemo", nc.uri, false);
// set up the handler for the new messages
// and delegate them to a local function
// this method will be called from the server when so.send is called.
so.newMessage = Delegate.create(this, newMessageHandler);
// connect to the SO using the netConnection reference
so.connect(nc);
// listen for the send button clicks
send.addEventListener("click", Delegate.create(this, sendMessage));
// add a listener for key events
Key.addListener(this);
function sendMessage():Void
{
// send via call to method on all the shared objects
// this will be reflected back down to clients by the server
so.send("newMessage", message.text);
// clear text input
message.text = "";
}
function onKeyUp():Void
{
if(Key.getCode() == 13 && message.length > 0)
{
// if ENTER was hit and there's a message to send,
// call sendMessage()
sendMessage();
}
}
347
BUILDING SOME RED5 APPS
function newMessageHandler(newChat:String):Void
{
// return if newChat is null
if(newChat == null) return;
// show in chat
history.text += newChat + "\n";
// scroll the chat window
history.vPosition = history.maxVPosition;
}
346
You don't actually need to write any Java code to make a decent chat
application. You can manage all the shared objects from the client side.
Since the client side is all the same with both Flash Media Server and Red5,
I would look into some examples written for that server as well. I hope that
helps.
-Chris
--
View this message in context: http://old.nabble.com/how-to-build-a-full-chat-web-application-like-paltalk.com-based-on-red5--tp31417469p31427047.html
346
You don't actually need to write any Java code to make a decent chat
application. You can manage all the shared objects from the client side.
Since the client side is all the same with both Flash Media Server and Red5,
I would look into some examples written for that server as well. I hope that
helps.
-Chris
--
View this message in context: http://old.nabble.com/how-to-build-a-full-chat-web-application-like-paltalk.com-based-on-red5--tp31417469p31427051.html
--
View this message in context: http://old.nabble.com/how-to-build-a-full-chat-web-application-like-paltalk.com-based-on-red5--tp31417469p31427180.html