A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: setInterval - I'm confused!

  1. #1
    Left-Handed Flash User mickbrit55's Avatar
    Join Date
    Nov 2003
    Location
    NJ USA
    Posts
    1,375

    setInterval - I'm confused!

    Hiya ....

    FLASH MX - Player 7.0

    I must be in "dumb-mode" today

    All I am trying to do is add a 5 second delay to the start of a movie using setInterval(). I have read Sen's article and read the reference, but I still can't get it to work. The movie starts on Frame 2 ... and my actionScript is on frame 1 :


    stop();
    function go() {
    gotoAndPlay(2);
    }
    var intervalID = setInterval(go, 5000,};
    clearInterval(intervalID);


    The error in the output window reads :


    Scene=Scene 1, Layer=action, Frame=1: Line 5: ')' or ',' expected
    var intervalID = setInterval(go, 5000, "0" };


    Probably something REAL simple

    Thanks

  2. #2
    [sleep.less.ness] euphoricGenius's Avatar
    Join Date
    Jan 2003
    Location
    insomnia
    Posts
    344
    you could simply use

    code:

    custard = setInterval(function (){clearInterval(this);gotoAndPlay(2);},5000)



    and remove the need for an external function call

    eG
     Beware Of Programmers Who Carry A Screwdriver

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center