Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Call the code every 60 seconds

Hi experts,
I have a little problem and hope that You will resolve it...
There is a code:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.onLoad = function() {
            status_txt.text += "Konektovanje..." + newline;
            nc.connect("rtmp://127.0.0.1/cam/");
            updateAfterEvent();
};

nc = new NetConnection();
nc.onStatus = function(info) {
      status_txt.text += "NC.onStatus> info.code: " + info.code + newline;
      if (info.code == "NetConnection.Connect.Success") {
            status_txt.text = "Konektovan na: " + this.uri + newline;
            createNetStream(this);
      }
}

createNetStream = function(nc){
      ns = new NetStream(nc);
      ns.onStatus = function(info) {
      //      status_txt.text += "NS.onStatus> info.code: " + info.code + newline;
      }
      mycam = Camera.get();
      mycam.setQuality(25600, 0);
      ns.attachVideo(mycam);
      myvid.attachVideo(mycam);

            status_txt.text += "Startovan prenos" + newline;
            ns.publish(stream, "live");

}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
The code works fine but I want to call the code again in loop every 60 seconds. Any idea how to do that?

Thanks in advance
Marko
0
prevarant
Asked:
prevarant
1 Solution
 
CerfCommented:
from flash help...

setInterval(functionReference:Function, interval:Number, [param1:Object, param2, ..., paramN]) : Number

example:

function myFunction () {
      trace("hello world!");
}

intervelID = setInterval(myFunction, 60000);
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now