We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Call the code every 60 seconds

prevarant
prevarant asked
on
Medium Priority
273 Views
Last Modified: 2010-08-05
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
Comment
Watch Question

Commented:
from flash help...

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

example:

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

intervelID = setInterval(myFunction, 60000);

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.