A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: using setInterval with other contols

  1. #1
    Member
    Join Date
    Apr 2002
    Posts
    81

    using setInterval with other contols

    I'm trying to set up some main timeline playhead controls that work with setInterval code (got from here) to pause for set lengths of time. I have attached sample movie. The pause button works until you start using the other play buttons. Can't figure out why the fastforward doesn't work. Help please.
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    It doesn't work because of the incorrect syntax. It should be
    code:
    on (release) {
    clearInterval(timer);
    gotoAndPlay("end");
    }


  3. #3
    Member
    Join Date
    Apr 2002
    Posts
    81
    Thanks. And from what I've read, if I want to jump to a scene, I have to put the actionscript on a timeline cell, not the button code, is that correct?

    Also, I noticed if I hit the forward (single right arrow) button a couple of times in a row quickly (like a user might do) that the pause function stops working and even the stop action at the very end seems to quit working. Any idea why or how to fix?

    thanks for any help you can offer.

    Dennis

  4. #4
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    Privet, Dennis
    And from what I've read, if I want to jump to a scene, I have to put the actionscript on a timeline cell, not the button code, is that correct?
    1. It's not quite correct, but I would not recommend to you to use scenes. It's not convenient. Everything may be done just using the frames or with loading the additional movies (swf).
    2. I've corrected you fla.
    Good luck.

  5. #5
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    Here is your fla
    Attached Files Attached Files

  6. #6
    Member
    Join Date
    Apr 2002
    Posts
    81
    Thanks so much for your help!

    In projects where I will use these controls, it is important to have a way for me to pause the playhead (long enough for users to read short text). I don't know where or how to do that in the fla file you posted.

    Also, what does the "delete this.onEnterFrame;" do?

    thanks,
    Dennis

  7. #7
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    code:
    function pauseIt(){
    if(pl){
    tt= getTimer();
    this.onEnterFrame = function(){
    ((getTimer()-tt)>2000) ? play() : stop();
    }
    }
    }


    If you want to define time of pause, you can make it by changing the value highlighted in red color. This is time in milliseconds.
    We have to delete this.onEnterFrame to stop function pauseIt().

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