  | | | OFFLIST: server side tracker... | OFFLIST: server side tracker... 2004-03-17 - By stefan - muchos.co.uk
Back silly question: does this work across all instances of a particular app or only per app instance? I could try I know... and I have actually used this method myself in the past but only ever connected to the same instance.
Stefan
-- --Original Message-- -- From: Simon Lord [mailto:slord@(protected)] Sent: 17 March 2004 19:43 To: flashcomm@(protected) Subject: [FlashComm] OFFLIST: server side tracker...
Oh my knee's are buckling with excitement! Ok, I'm still a freshman in AS compared to you guys on the list. So humor me and let me see if I got this right:
I simply create a new flash file, and shove the following into frame one. When compiled and run it will simply connect to FCS and, from what I can tell, will remain connected until the app is closed.
> function connect() > { > nc.close(); > nc = new NetConnection(); > nc.owner = this; > nc.onStatus = function(o){ > trace("*** NetConnection.onStatus ***"); > for(var p in o){ > trace(p + ": " + o[p]); > } > if(o.code == "NetConnection.Connect.Success"){ > this.owner.onConnected(); > } > }; > nc.connect("rtmp:/usertest"); > } > > function onConnected() > { > trace("connected"); > var r = {}; > r.owner = this; > r.onResult = this.onResult; > nc.call("getUserAmount", r); > } > > // <<< Server to Client <<< > function onResult(useramount) > { > trace("agruments: " + arguments); > trace("There are " + useramount + " users in app " + nc.uri); > trace("Drop it... yo... :: record scratch :: ge-ge-ge-get Fresh!"); > } > > connect();
For the server side I'm very lost. What do you recommend here? This doesn't look to me like a script that needs to be placed in an asc all on its own. Or can it? If I do then I need to include it which I *do* know how to do. ;)
I'm getting there. Been a very difficult year for me, had to learn Flash & FCS at the same time - full immersion and it hasn't actually been a full year yet. The swelling in my brain is only starting to go down.
Thanks for the script, you really saved my ass from doing the worst PHP/mysql hack on the planet!
> Server-Side > -- ---- ------ > application.onConnect = function(client) > { > client.getUserAmount = function(){ > trace("getUserAmount"); > return (application.clients.length); > }; > application.acceptConnection(client); > } >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Supported by Fig Leaf Software -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Lower Prices for Certified Training! Check out new lower prices for Certified Macromedia Training from Fig Leaf Software. Expand your skill set with courses in ColdFusion, Flash, Rich Internet Applications and .NET in the new year. Fig Leaf Software provides the highest caliber instruction at our training centers in Washington D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location.
Get the details at http://training.figleaf.com/ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: flashcomm-unsubscribe@(protected) For additional commands, e-mail: flashcomm-help@(protected)
|
|
 |