A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: setTimeout not working

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    10

    setTimeout not working

    Any suggestions on why the timeout is not working on this? goal is for their to be 3sec pause before onMouseDown function is activated (code is on a frame inside mc1):

    stop();

    var wait:Number = setTimeout(_root.onMouseDown, 3000);

    _root.onMouseDown = function(){
    if (_root.mc32.currentframe != 17){
    _root.mc1.play();
    delete _root.onMouseDown;
    }
    }

  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    First of all, you keep forgetting the "_" underscore between "current" and "period":
    _root.mc32._currentframe.

    Second:

    stop();



    _root.onMouseDown = function()
    {
    var wait:Number = setTimeout(check, 3000);
    }

    function check()
    {
    if (_root.mc32._currentframe != 17){
    _root.mc1.play();
    trace("Sadasda");
    delete _root.onMouseDown;
    }
    }
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

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