I use Cobra and I am trying the example “Using Adobe Flex to have Live data on Web Site” (Link: http://www.tinyclr.com/codeshare/entry/315)
There are some codes in the “SocketServer.cs” of this project as follow:
// Check Button Status and if change update web page
if ( (!buttonUp.Read()) && (buttonUpState == false) )
{
buttonUpState = true;
byte[] reply = Encoding.UTF8.GetBytes("<mxs:Button1>1<mxe:Button1>\n");
reply[reply.Length - 1] = 0;
m_clientSocket.Send(reply);
}
else if ( buttonUp.Read() && (buttonUpState == true))
{
buttonUpState = false;
byte[] reply = Encoding.UTF8.GetBytes("<mxs:Button1>0<mxe:Button1>\n");
reply[reply.Length - 1] = 0;
m_clientSocket.Send(reply);
}
It seems that the status of button1 is sent by sockt to somewhere(html/javascript), but how can the status be received by html file or javascript file?
I haved checked all html files and javascript files in Resources folder, but I didn’t see any socket-receive for the status of button1. I can’t open the swf files
Can any body tell me, how can I send/receive the data to html/javascript?