Groups | Blog | Home
all groups > macromedia flash flashcom > june 2006 >

macromedia flash flashcom : A compenent question


Al Capique
6/2/2006 5:57:25 PM
Hi

I starded with FMS a few days and I tring a exemple to understand some things.

My movie only has a SimpleConnect Compenent and a want that the server-side
call a function created by me on the client.

ex:

//SimpleConnect Action Script
this.main_nc.f = function()
{
trace("f");
}

//main.asc
application.onConnect(client, instance, name, password)
{
client.call("f");
}

Is it Possible? Create a function in SimpleConnection?s NetConnector and acess
it via Application main.asc file?
ekameleon
6/2/2006 11:48:56 PM
Hello :)

use NetConnection class :


[AS]

var nc:NetConnection = new NetConnection() ;

nc.onStatus = function ( oInfo ) {

trace( "> " + oInfo.code) ;

}


nc.test = function ( msg ) {
trace("test : " + msg) ;
}

nc.connect("rtmp://127.0.0.1/yourApplication") ; // use your rtmp uri !!
[/AS]

et server side :

[SSAS]
application.onConnect = function (client) {

client.call("test", null, "hello world") ;

}
[/SSAS]

NB : important onConnect is a Function !!

Read FMS documentation !! it's important :)

EKA+ :)

PS : sorry for my english i'm french ;)



Al Capique a écrit :
[quoted text, click to view]
AddThis Social Bookmark Button