PDA

View Full Version : Integrate flash with Java quickserver


tania_lynne
02-01-2006, 03:13 AM
I DO NOT know Java at all. A java developer installed quickserver on my server and it is alive and running and has been tested. I can receive a successful connection with flash, but I cannot send or receive data. Can anyone help me? I have done a ton of research on xmlObject in flash and Java itself. I am a flash developer, this shouldnt be that hard, but it seems like something is missing. If someone can please help me - knows anything about quickserver or anything about connecting a java server to flash - I would greatly appreciate it.

The IP address is 207.241.153.152 and when it seems to be up.

var theSocket:XMLSocket = new XMLSocket();
theSocket.connect("207.241.153.152", 7412);

theSocket.onConnect = function(myStatus) {
if (myStatus) {
conn_txt.text = "connection successful";
trace("success")
} else {
conn_txt.text = "no connection made";
trace("failure")
}
};

will trace success, but these do nothing:


function sendData() {
var myXML:XML = new XML();
var mySend = myXML.createElement("thenode");
mySend.attributes.myData = "someData";
myXML.appendChild(mySend);
theSocket.send(myXML);
}
// button sends data
sendButton.onRelease = function() {
sendData();
};
// traces data returned from socket connection
theSocket.onData = function(msg:String):Void {
trace(msg);
};


Everything I have read makes it sound super easy, so I think there must be something I am leaving out.

Thanks.
Tania

pan69
02-01-2006, 04:41 AM
What does your server expects as a termination character? Have you tried adding a "\n" at the end of your string? You may look into the documentation of your server app that is receiving the string what character it's waiting for.


theSocket.send(myXML + "\n");