I’m using the Flash XML socket class to hook up to a CF server. On CF side I’ve configured the Socket Eventgateway with a listener CFC with the following code I riped from the adobe site
<cfcomponent displayname=“echo” hint=“echo messages from the event gateway”>
<cffunction name=“onIncomingMessage” output=“no”>
<cfargument name=“CFEvent” type=“struct” required=“yes”>
<!--- Create a return structure that contains the message. --->
<cfset retValue = structNew()>
<cfset retValue.DestinationID = arguments.CFEvent.OriginatorID>
<cfset retValue.MESSAGE = "Echo: " & arguments.CFEvent.Data.MESSAGE>
<!--- Send the return message back. --->
<cfset Flash.Result = retValue>
<cfreturn Flash.Result>
</cffunction>
</cfcomponent>
this is suppose to send the info that the user sends right back to flash, but it doesn’t. Instead in the cf administrator, i’m getting a message that says
Here is what I have on the Flash side
Cannot send outgoing message. OriginatorID '32921119' is not a valid socket id. The number itself is made by the CF server. So my question is. CAN SOMEONE PLEASE HELP!!!
everytime i run the swf i get a new socket id number so its always changing.
Here is what i have on the flash side
//call the function to get the username, set the result to a global variable to use elsewhere
var username = “Mr.Pointy Haired Boss”
var mysck:XMLSocket = new XMLSocket() //new xmlsocket object
mysck.connect(“192.168.1.100”,4445) //connection to socket server
mysck.onConnect = function(success){
if(success){
trace(“The connection has been made”)
}
else{
trace(“The connection has failed”)
}
}
send_mc.onRelease = function(){
var mystr:String = “<message><sender>”+username+"</sender><body>"+input_txt.text+"</body></message>"
var myxml:XML = new XML(mystr)
trace(myxml)
mysck.send(myxml)
}
mysck.onData = function(data){
message_txt.text = data
}
I’m seding the message as a string with an xml format. I’ve been reading up on this non stop and i feel clueless
.