Hi there@
Try this one.

this.con_nc = new AppConnector();
this.con_nc.connect("rtmp://localhost/proof");
//this.con_nc.connect(null);
this.con_nc.addListener(this);
this.ns = new InfoNetStream(this.con_nc);
//
this.onConnect = function() {
        trace("onConnect");
};
this.onFailConnect = function() {
        trace("connection fail");
};
////////// AppConnector.AS
dynamic class AppConnector extends NetConnection {
        var addListener:Function;
        var removeListener:Function;
        var broadcastMessage:Function;
        function AppConnector() {
                super();
                AsBroadcaster.initialize(this);
        }
        function onStatus(info) {
                var code = info.code.substring(info.code.indexOf(".")+1);
                trace("onStatus:"+info.code);
                switch (code) {
                case "Connect.Success" :
                        broadcastMessage("onConnect");
                        break;
                case "Connect.Rejected" :
                        connectionClosed("onReject", info);
                        break;
                case "Connect.Closed" :
                        connectionClosed("onClose", info);
                        break;
                case "Connect.Failed" :
                        broadcastMessage("onFailConnect");
                        break;
                case "Connect.AppShutdown" :
                        connectionClosed("onClose", info);
                        break;
                case "Connect.InvalidApp" :
                        connectionClosed("onReject", info);
                        break;
                case "Call.Failed" :
                        broadcastMessage("onCall");
                        break;
                }
        }
        function connect() {
                trace("go connect connect");
                return super.connect.apply(super, arguments);
        }
        function close() {
                super.close();
        }
}
////////// InfoNetStream.AS

class InfoNetStream extends NetStream {
        function InfoNetStream(nc) {
                super(nc);
        }
        function onMetaData(info) {
                for (var p in info) {
                        trace(p+": "+info[p]);
                }
        }
}

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of eric dolecki
Sent: Tuesday, September 19, 2006 5:20 PM
To: Flashcoders mailing list
Subject: [Flashcoders] NS status calling a func in a class?

Sorry - I've been in the hospital for a few months, so I forgot how this
works.

In a class, in its init, I have this code:

my_ns.onStatus = function( infoObject:Object ):Void {
            if( infoObject.code == "NetStream.Play.Stop" ){
                callFunction();
            }
        };

I need that callFunction to be called, however what is the scope here? How
can that be set up to call a private function of the class itself?

I checked the archives but didn't really see anything straight away.

- e.
_______________________________________________
[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

_______________________________________________
[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

Reply via email to