Hi there, this is my first post so hi everyone:)
I am trying to extend the WSC Class into a class that will call a web service at a set interval so i can just create an instance of it in any of my movies and a listener and it will just keep sending info to the web service or trying to retrieve information from it. I am trying to access the super class of my custom class to set the vars but I cant seem to get it to work, plus the ws only triggers once and then doesn't seem to trigger again although the sendLog function is called.
if anyone has any ideas, I would be really glad to hear them.
Thanks :)
Ali

////////////////////AS////////
class CheckChat extends WebServiceConnector {
        var active:Boolean;
        //interval vars
        private var checkInterval:Number;
        private var checkFreq:Number;
        private var log:String;
        //constructor:
public function CheckChat(WSDLURL, operation, suppressInvalidCalls, frequency:Number) {
                super(WSDLURL, operation, suppressInvalidCalls);
                checkFreq = frequency;
        }
        // methods:
        function sendLog():Void {
                trace("sendLog called");
                //could be used to send data
                //this.params = [log];
                myWSC.trigger();
                //return log;
        }
        //switches the function on and off
        function activate(myBoo:Boolean):Void {
                clearInterval(checkInterval);
                if (myBoo) {
                        trace("interval set");
                        sendLog();
                        checkInterval = setInterval(sendLog, checkFreq);
                } else {
                }
        }
        //this is used to add info to the log
function addToLog(time:Date, type:String, info:String, id:String):Void {
                trace("add to log:"+time+":"+type+":"+info+":"+id);
                log += "\r"+type+": "+info+":"+id+"  "+time;
                trace("log is now:"+log);
        }
        // events:
}
-----FLA
import mx.data.components.WebServiceConnector;
import CheckChat;
var myChecker:CheckChat = new CheckChat("http://myweburl/ webservice.asmx?WSDL", "GetServerStatus", true, 3000);
var res:Function = function (evt:Object) {
        trace(">>>"+evt.target.results);
};
myChecker.addEventListener("result", res);
myChecker.activate(true);

///////////////////////////////

_______________________________________________
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