A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Pausing a movie with getTimer?

  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    102
    Hey. I need to pause a movie for like 40 seconds at certain frames... then I need it to play. How can I do this. I can use getTimer right? If so, how? Thanks!

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    sweden, östersund
    Posts
    263
    hmm..

    Code:
    onClipEvent(load){
       _parent.stop();
       var timet=Math.round((getTimer()/1000)+40);
    }
    onClipEvent(enterFrame){
       if(timet==Math.round(getTimer()/1000)){
    		_parent.play();
       }
    }
    paste this on a movie clip.

    masa.

  3. #3
    President, save the
    New Zealand dollar foundation

    Join Date
    Jun 2000
    Posts
    1,743
    or put this function in the _root,
    Code:
    _root.doPause = function(movie, gap) {
        movie.stop();
        var startTime = Math.round(getTimer()/1000);
        this.checkTime = function() {
            var time = Math.round(getTimer()/1000);
            if (time >= startTime + gap) {
                clearInterval(this.doCheckTime);
                movie.play();
            }
        }
        this.doCheckTime = setInterval(this, "checkTime", 1);
    }
    and call it from your movie frame with:
    Code:
    // 40 for 40 second pause
    _root.doPause(this, 40);

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