> on the client side I have
>
> nc.call("sayHelloServer", serverret())
>
> on serverret a, b
> put &a , &b
> end
>
> the server side code is called and lingo do go to "serverret"
> function, However, &a and &b gives blank. a and b gives void. In other
> words, the server side value "flashcom server rocks" does doesn't
> received by lingo. Can anyone tell me the code to do this?
Mary,
This is wrong. You are calling serverret() directly from that first line,
it's not being returned as a callback from the server at all.
Tom is right in that you need to change your callback handler, but what you
forgot is to so a setCallBack() on the FlashObject in Lingo. Also can you
actuallu use 'return' on the server side and expect that to trigger a
function back on the client? I think you need to send a message back to the
client??? You will probably need a Flash Sprite in Director to successfully
create a NetConnection FlashObject in Lingo. Does anyone have any barebones
examples for Mary here?
I added some stuff but this is just pseudo code... You need to work on the
back and forth communication, cause as is, there is nothing in your server
code calling back to the client.
--Lingo Client
on beginSprite (me)
--connection
nc = sprite(me.spritenum).newObject("NetConnection")
sprite(me.spritenum).setCallback(nc, "onStatus", #nc_onStatus, me)
sprite(me.spritenum).setCallback(nc, "setId", #nc_setUserID, me)
--Connect
nc.connect("rtmp://yourURI.com/app", "username")
--FROM HERE ON YOU NEED SOME WORK--------------->>
nc.call("sayHelloServer")
setCallback(nc, "serverret", #serverret, me)
end
on serverret (me, fo, a, b)
put a, b
end
//AS FCOM SERVER SCRIPT --this needs work too...
application.onConnect = function(clientObject, username){
application.acceptConnection(clientObject);
clientObject.sayHelloServer = function(){
trace("the client say hi");
return ("flashcom server rocks.");
};
}
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]