Call the code every 60 seconds

Posted on 2006-03-30
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 = 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 = 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);

            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
Question by:prevarant
    1 Comment
    LVL 8

    Accepted Solution

    from flash help...

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


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

    intervelID = setInterval(myFunction, 60000);

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
    The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now