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,
cedric



class 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);


        }

}

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

Reply via email to