:: flash help ::

  • Started
  • Last post
  • 8 Responses
  • freshmode

    Is this possible?

    I want to load a movie clip that detects when the mouse is over it. If the mouse is over, then it will stop the time line, if the mouse isn't over it, then the time line will resume.

    anyone?

    Thanks in advance!

  • unformatted0

    why do you have to load a movieclip to do that?

    just do an onclipevent for onmouseoff and onmouseon and put the actions _root.stop() or _root.play().

    unless i misunderstood. :)

  • freshmode0

    I guess that could work as well.

    The movie clip that gets loaded, has a 10 sec timeline of nothing. I figured, instead of a long ass time line in my content, just do it with a movie clip. Also, that movie clip gets called by other clips.

    What I am trying to achieve is this.

    Movie clip loads, holds for 10 sec, then fades out. New movie clip loads, holds for 10 sec, then fades out. New movie clip loads, holds for 10 sec, then fades out. Loop.

    I figured, their could be a stop function, then a loadmovie function that loads this 10 sec clip. This clip has an action that unloads it's self and plays the root movies timeline. Get it?

    That way, any clip can call it and their is only 1 clip with a 600 frame timeline.

    I don't know the script so if you can help, please do.

    Thanks again.

  • unformatted0

    well if all those movies are being loaded into the same mc, just put this in your actions layer.

    mcNAME.onclipevent (mouseover) {
    _root.stop();
    }

    mcNAME.onclipevent (mouseout) {
    _root.play();
    }

    or you could try to make a timer function. havent' dont a timer function so can't help you with that. but probably not that hard.

  • freshmode0

    :: bump ::

    can anyone else help out with this?

    Thanks in advance.

  • lvl_thirteen0

    okay this is what i use:

    make a movie clip with 8 frames

    frame one:
    play();
    tellTarget ("../") {
    stop();
    }

    frame two:
    start = Number(getTimer()/1000);
    end = start+pause-3;
    //you can change -3 to anything you want to reflect your total time you want it to pause

    frame three (with a frame label "checktime"):
    current = Number(getTimer()/1000);
    if (current >= end) {
    tellTarget ("../") {
    play();
    }
    } else {
    play();
    }

    frame 4-7: leave blank

    frame eight:
    gotoAndPlay("checktime");

    then right click or control click on the movieclip you just created in the library window.

    go to 'component definition...' in menu.

    press the '+' and change 'varName' to 'pause' and 'defaultValue' to '5'

    now place this compontent anywhere on your movie.

    this is a long way to do it, and there is probably a easier way, but this works everytime for me and once it is created once, you can just always copy and paste it and change the value to whatever you want.

  • lvl_thirteen0

    ^^
    by the way, that code is for the pause timer clip movie only :)

  • freshmode0

    a few questions.

    where the scrip says,

    "tellTarget("../"){..."

    Should I add the name of the file after the ../?

    Question 2

    On frame 2 where it says "(getTimer()/1000)"

    What is the 1000? Is that frames or seconds?

    Also frame 2
    "start+pause-3"
    Does that pause for 3 seconds then resume to the next frame?

    Thanks again for the help

  • lvl_thirteen0

    check your email. i sent you an example.

    as far as the '../' do you mean a file that is being loaded in? if it is a file being loaded in then you actually want to put the pause clip in that movie (that is being loaded) and you put it in the actual timeline that you want to pause. all '../' means is that it is checking right outside of the pause clip, which is the actual timeline you put the clip into. sorry if this sounds hella confusing.

    2. the getTimer is the conversion to seconds. so basically it is taking the time in seconds times 1000. by dividing the time by 1000 you are getting actual whole interger seconds like 1, 2, 3, etc. not 1000, 2000, 3000

    2-2. it actually pauses for 2 sseconds because the clip is set to a default of 5. so it is (5)-3=2

    the default can be changed in the components panel, but i usually just change it in the movie clip.

    does any of this make sense? i am really bad at explaining things.