A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Movie Clip Time Out/Wait Function

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    13

    Movie Clip Time Out/Wait Function

    Hello,

    I have a Flash 8 movie where I need to have a movie clip that will periodically appear on stage in certain frames. After reaching a frame containing the movie clip -the movie clip needs to time out/wait for five seconds before it plays.

    What ActionScript would accomplish this? Should the ActionScript be located in the first frame of the movie or embedded within the movie clip?

    I attempted to use the following code within the movie clip and although it worked to control the movie clip, it interfered with cue point .flv goToAndStop functions on the main timeline:

    Code:
    function wait() {
       stop();
       var myInterval = setInterval(function () {
          play();
          clearInterval(myInterval);
       }, 5*1000); // stop for 5 seconds
    }
    wait();
    Thanks!

    James

  2. #2
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    place this in the frame where you wish the timeout to occur.
    PHP Code:
    stop();
    setTimout(func0,5000);
    function 
    func0(){
          
    play();

    ~calmchess~

  3. #3
    Junior Member
    Join Date
    Mar 2009
    Posts
    1
    Thanks for the suggestion. Please consider the following.

    The problem with the code used in the first note was that it interfered with the .flv cue point actions on the main time line. Perhaps the reason for that is because the wait and play code needs to be targeted to a specific _mc. Instead the wait and play code was interfering with goToAndStop code used with the .flv and cue points.

    Is there any other code that would target the _mc with the wait and play code. And if so, what would that be?

    Thanks.

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