A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: creating a delay

  1. #1
    Senior Member
    Join Date
    Apr 2003
    Location
    Seattle
    Posts
    176

    creating a delay

    Hello,

    I'm working with flash 8 and I have a 100sec soundclip that plays with the images at 12fps. Problem is the sound invariably ends before the images. I don't mind sound/image being out of psynch -I just want the images to cut off regardless of where they are when the sound ends. Any suggestions?

    I wonder if it is possible to create a kind of an actionScript timer that counts actual seconds rather than # of frames so that after pausing/sleeping/waiting 100sec's, the action gotoAndPlay(frame label) is executed. Is this possible or is there a better way around the problem?

    Any help would be greatly appreciated.

    -Llyfre

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    You need to use actionscript.

    var mySound:Sound = new Sound();
    mySound.loadSound("sound.mp3");
    mySound.onLoad = function()
    {
    this.start(0,1);
    }
    // here is the important part
    mySound.onSoundComplete=function()
    {
    //enter something to terminate the image
    }
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member
    Join Date
    Apr 2003
    Location
    Seattle
    Posts
    176
    Thanks cancerinform. I got a hold of a timer that works like a charm. Here's what it looks like-

    On the timeline:

    timer = setInterval(goto, 100000);
    function goto(){
    gotoAndStop(3);
    //Or whatever else you want it to do.
    clearInterval(timer);
    }

    -Llyfre

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