A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: time laps triggers

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Is there a way to trigger a Target/movieclip based on the user takin too much time?

    example: 30 seconds without the user choosing anything
    a warning shows up or a demo would play similar to a video game??


  2. #2
    Junior Member
    Join Date
    Jun 2001
    Good idea munger, Do you mean takes to long between clicks, or moving the mouse? Either way it's pretty much the same idea.

    create an empty MovieClip on the root timeline. In that MovieClip, go to the frame that you want to have an action triggered; say 30 seconds * 12 frames per second = frame #360. Set a keyframe and have whatever you want to have happen, happen. Maybe a Yes/No box or something.

    then go to the main timeline again and click on your empty movie clip. Open up it's actions but don't enter into the MovieClip's timeline by right clicking on it and going to "Actions". Insert the following:

    onClipEvent(mouseMove, mouseDown, keyDown){ //or whatever event you want to have RESET the counter

    what happens is now you have long movieClip that is playing, trying to get to the 360th frame so it can run it's Yes/No box thing. If the user moves the mouse, clicks the mouse, or presses a key, the movieClip starts counting all over again.

    If you just want it to reset when the user chooses something, take away the mouseMove and keyDown from the onClipEvent() above.

  3. #3
    Infinite Loop grvdgr's Avatar
    Join Date
    Feb 2001
    You could use a frame loop. Set the loop up to stop when a visitor selects an option that takes them to another frame.

    frame 1

    frame 2
    index ++

    frame 3
    if (index>360) {
    stop ();
    } else {
    gotoAndPlay (2);

    You could also put this in a one frame MC
    Hope this helps

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