Hey Cedric, thanks a lot, man! It works. That was just killing me. Sometimes it doesn't matter how many O'Reilly books you read, you gotta have someone tell you how it is.
Thanks again!
At 12:18 PM 4/25/2006, you wrote:
what about: class classes.CheckBW { var nc:NetConnection; var ns:NetStream; var whichServer; var counter; var vidQuality:String; var owner:Object = this; public function bwCheck(whichServer):Void{ nc = new NetConnection(); nc.onStatus = function(info) { trace("Level: "+info.level+" Code: "+info.code); NetConnection.prototype.onBWDone = function (p_bw) { trace("onBWDone: "+p_bw); if (p_bw != undefined) { owner.returnBW(p_bw); } }; function returnBW(p_bw) { trace("returnBW called"); if (p_bw>=400) { vidQuality = "_med"; } else if (p_bw<400 && p_bw>=150) { vidQuality = "_low"; } else if (p_bw<150) { vidQuality = "_low"; } } NetConnection.prototype.onBWCheck = function () { return ++counter; // Serverside, just ignore any return value and return the call count }; }; nc.connect(whichServer); nc.call("checkBandwidth", null); } } ?? (just added the 'owner') hth, cedricclass classes.CheckBW { var nc:NetConnection; var ns:NetStream; var whichServer; var counter; var vidQuality:String; public function bwCheck(whichServer):Void{ nc = new NetConnection(); nc.onStatus = function(info) { trace("Level: "+info.level+" Code: "+info.code); NetConnection.prototype.onBWDone = function (p_bw) { trace("onBWDone: "+p_bw); if (p_bw != undefined) { returnBW(p_bw); } }; function returnBW(p_bw) { trace("returnBW called"); if (p_bw>=400) { vidQuality = "_med"; } else if (p_bw<400 && p_bw>=150) { vidQuality = "_low"; } else if (p_bw<150) { vidQuality = "_low"; } } NetConnection.prototype.onBWCheck = function () { return ++counter; // Serverside, just ignore any return value and return the call count }; }; nc.connect(whichServer); nc.call("checkBandwidth", null); } }_______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
---asai
_______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com

