Looping Background Movie Clip

Hi i am having trouble with having a looping background movie
clip on the bottom layer of my flash project. I have it on the
bottom layer in the first frame, above it i have some menus fading
in and it seems as though once it gets to this scene, it just plays
the movie clip over and over and never goes to the 2nd frame of my
scene. Is there anyway to have a looping background movie clip
inside of flash 8?
Thank you in advance,
Tyler

You can use a variable to keep count of how many times you loop, and until it exceeds a particulr value (2 or 3) you execute a setTimeout() call that waits for however long you want to delay and then tells the movieclip to gotoAndPlay(1).
So in the first frame you would establish the counting variable...
var count;
if(count == undefined){ // only set it to 0 once
count = 0;
and in the last frame you would do your incrementing and control....
stop();
count += 1;
if(count < 3){
setTimeout(waitABit, 2000); // call function in 2 secs
function waitABit(){
gotoAndPlay(1);

Similar Messages

  • Looping a movie clip a specific number of times in Flash

    Does anyone know how to get a movie clip to loop a specific number of times in Flash? I know how to stop a movie clip from looping by using the this.stop (); command by placing the command in a separate Action Script layer, in a keyframe, inside of the movie clip's timeline. This allows the movie clip to play through once and then stop. But I need for the movie clip to loop more than once, maybe 2 or 3 times, and then go back to the main timeline. Does anyone know the code for this?
    Also, is it possible to place a pause (I'm guessing, maybe by using a timer of some type?) between the loops, so that the movie will pause a couple of seconds before it loops again and then stop? Please note I do not need the movie clip to stop when there's an event like a rollover or anything. I just need it to play a couple of times, pause between plays and then stop and go back to the main timeline. Please let me know if anyone can help.
    Thanks,
    Sarah
    P.S. Is there a good, easy to use, reference book anyone can recommend for creating specific things in Flash using Action Script? Do you guys have a favorite for beginners like me?

    You can use a variable to keep count of how many times you loop, and until it exceeds a particulr value (2 or 3) you execute a setTimeout() call that waits for however long you want to delay and then tells the movieclip to gotoAndPlay(1).
    So in the first frame you would establish the counting variable...
    var count;
    if(count == undefined){ // only set it to 0 once
    count = 0;
    and in the last frame you would do your incrementing and control....
    stop();
    count += 1;
    if(count < 3){
    setTimeout(waitABit, 2000); // call function in 2 secs
    function waitABit(){
    gotoAndPlay(1);

  • How to replay( looping ) a movie clip which animated by action script?

    My movie clip has only one frame, I animate it by using
    action script.
    How can I looping its animation?

    quote:
    Originally posted by:
    dzedward
    if you're using the Tween class, listen for onMotionFinish
    (as2) or MOTION_FINISH (as3) to start the tween over.
    no, my movie clip was animated by using for loop. What I want
    to do is no matter where I put my movie clip, it will contnuously
    move from left to right.

  • How do I loop a movie clip?

    I have a 15 sec. movie clip of a burning fire. I need to stretch or loop the clip to about 12 minutes long. But how do I do that in iMovie. I would like a smooth transition between the loops.
    (Using my old Mac with iMovie HD 6)

    iMHD6 supports copy/paste..
    select the clip, Apple-C, Apple-V .. 30sec
    select both clips, Apple-C, Apple-V .. 60sec
    select all clips, Apple-C, Apple-V .. 2min
    select all clips, Apple-C, Apple-V .. 4min
    select all clips, Apple-C, Apple-V .. 8min
    select all clips, Apple-C, Apple-V .. 16min ooops ..
    add dissolves +al gusto+ ..

  • Dynamic text in looping movie clip

    Hi,
    I am looping a movie clip which has a dynamic text box. I
    need to call data from XML and place the same in the Dynamic text
    box as per the duplicated movie clip. how do i do that.
    Thanks,
    Ayush

    on (release) {
    _parent.frontFields.topTextArch.ph2TopTextBrush._visible =
    false;
    That is the script attached to my button. I can see the text
    flash for a second when I push the button but it does'nt go away
    because the looping movie clip just continually goes back to the
    first frame and makes the ph2TopTextBrush text field visible again.
    I think I know what your saying. Your saying to attach a
    script to the first frame of the looping movie clip that would
    check to see which of the 3 dynamic text fields are visible. That
    would be perfect but I'm not sure how to do it.
    What would the script that I place on my button look like?
    What would the script in the first frame of the looping movie clip
    look like?

  • Looping movie clips

    I want to loop 5 movie clips so that one clip moves onto the stage, stays there for a certain time, then moves off the stage, then the next one.
    Any help is greatly appreciated!
    Here's what I've got so far:
    var m1_mc = new m1();
    var m2_mc = new m2();
    var m3_mc = new m3();
    var m4_mc = new m4();
    var m5_mc = new m5();
    currentPage = m1_mc;
    var timer:Timer = new Timer(1000);
    timer.addEventListener(TimerEvent.TIMER, onTimer);
    timer.start();
    function onTimer(evt:TimerEvent):void {
    for (var i:Number = 0; i<5; i++){
    prevPage = currentPage;
    var exitTween:Tween = new GCSafeTween(currentPage,"x",Strong.easeOut,currentPage.x,-800,12,false);
    //this is where I am getting stuck. Not sure how to write currentPage + 1 to make the next movie clip play
    exitTween.addEventListener(TweenEvent.MOTION_FINISH, animateOn);
    function animateOn(e:TweenEvent):void{
    var enterTween:Tween = new GCSafeTween(currentPage,"x",Strong.easeOut,-800,0,12,false);

    You should probably step back and rethink things a bit, though not entirely, possibly take it one step at a time.  Get one piece to play properly, then work in having 5 of them.  Using the tween event listeneres amd the timer to trigger things is a good approach.
    Tween-In -> Timer -> Tween-Out -> next Tween-In...
    That for loop inside the function will execute immediately, creating 5 tweens for the currentPage, etc... which is not what I think you want.
    Use a counter variable to keep track of which mc you are dealing with and use it/increment it to define which mc you are dealing with...
    var mcNum:uint = 1;
    var currentPage:MovieClip = this["m"+mcNum+"_mc"];
    and don't forget that you need to add the instances to the movie before you can expect them to be present/visible in any way (addChild())

  • I Can't stop my movie clip from looping

    This is probably an easy fix, but I obviously can't get it. Below is the actionscript to loop my movie clip, but once it's activated, I can't get it to stop. I thought it would stop at 3. What did I miss??
    Any help? Flash 8 (CS2).
    on (rollOver){
        for (i=0; i<=3; ++i){
            audio_mov.duplicateMovieClip("audio_mov" +ii);

    remove the stop() from the first frame of blur and assign your button an instance name (eg, btn).  then see if this does what you want:
    blur.stop();
    var tl:MovieClip=this;
    btn.onRollOver=function(){
    blur.play();
    btn.onRollOut=function(){
    tl.onEnterFrame=function(){
    if(blur._currentframe==1){
    blur.stop();
    delete this.onEnterFrame;

  • Movie Clip is not looping AHH

    So I got this video that is streaming from the server on the stage (starting a new movie clip). I then have a mask over it to create a diamond shaped movie clip. However, once I take it into the main timeline and export as movie...when I view it--it is not looping...it's only playing once. Any ideas on what's going on? THANKS!

    I found the answer via http://www.kristenstephenson.net/?p=333&cpage=1#comment-259. Working code:
    import fl.video.VideoEvent;
    ksvid.autoRewind = true; // fl_video being the name of the video component
    ksvid.addEventListener(VideoEvent.AUTO_REWOUND, doLoop);
    function doLoop(e:VideoEvent):void
    e.target.play();
    The only difference from her way of placement was that because I have the f4v as a progressive download in a movie clip as a flash playback with a mask (*pheww)...I had to make a cuepoint at the end of the video and then place the actionscript within the movie clip as its own layer.
    SUCCESS!

  • Stop(); not working. Movie clip is looping.(AS2)

    I have made a movie clip that needs to play till the last frame and then stop there, but not dissapear. Right now, as I am putting the command stop(); on the first frame of the movie clip and on the last frame too, nothing is changing, the movie clip is still looping and does not stop at all.
    What could be the problem?
    p.s. I am really a beginner in Adobe Flash.

    Can you show a screenshot of the timeline and where the stop() command are placed?  If stop(); is the only code you are using then it sounds like you are putting the code in the wrong place.

  • Looping movie clip stops in middle

    I am using a movie clip as part of a game. It's a clip of a
    spaceman walking.
    When the game is being played, the movie seems to loop one
    time (the spaceman walks one cycle), and on the second time around
    the animation seems to stop right in the middle of the cycle. it
    always stops on the same frame.
    What is happening here?
    Thank you

    Okay, great, and what about the last line? What is that for?
    Do i put my keylistener info after that line?
    I'm still a little puzzled about where to put the script that
    you just offered me.
    But before I get to that, let me ask you a question about my
    current code. Below I've pasted the beginning of the code that I
    have for Key Down. My question is: Is this code going to execute
    over and over again? Is this code a "key listener"?
    _root.onKeyDown = function() {
    ///keyDOWN!!!
    whichKey = Key.getAscii();
    if ((whichkey == _root.jumpkey) or (whichkey ==
    _root.jumpkeycaps)) {
    if (_root.mov == "walkleft") {
    _root.mov = "jumpleft";
    _root.vertspeed = 24;
    if (_root.mov == "walkright") {
    _root.mov = "jumpright";
    _root.vertspeed = 24;
    if (mov.toLowerCase().indexOf("stop") != -1) {
    _root.mov = "jumpup";
    _root.vertspeed = 24;
    }

  • Captivate movie clips looping in Flash

    I've read the discussions on the forum, but nothing seems to
    be able to stop a captivate 2 movie clip from looping when brought
    into Flash. I exported the captivate movie with the default values,
    converted it to a movie clip in Flash8 so I could resize it,
    brought the movie clip into the Flash movie by dragging it to the
    stage. Everything looks great, but I can't stop the clip from
    looping. Stop commands placed within the movie clip seem to have no
    effect nor do commands put on the main timeline.
    Thanks for the help.

    Hi there
    Hopefully someone here will have an answer for you. In the meantime you might also wish to post this question in the forums for Acrobat.
    Click here to visit the Acrobat forums
    Cheers... Rick
    Click here for Adobe Certified Captivate and RoboHelp HTML Training
    Click here for the SorcerStone Blog
    Click here for RoboHelp and Captivate eBooks

  • Quick question about looping movie clips

    I'm a REAL Flash novice, and I'm trying to get a movie clip to loop 3 times, and then continue on.
    Here's the code I've written (I'm sure it's painful to see)
    stop();
    if (!loopCount) {
      var loopCount:Number = 0;
    loopCount++;
    if (loopcount < 3) {
    gotoAndPlay (1)
    if (loopCount = 3) {
      gotoAndPlay(363);
    Could someone help me out?
    Thanks,
    Brandon

    use double equal (==) to test for equality:
    stop();
    if (!loopCount) {
      var loopCount:Number = 0;
    loopCount++;
    if (loopcount < 3) {
    gotoAndPlay (1)
    if (loopCount == 3) {
      gotoAndPlay(363);

  • Button Movie Clips Loops Ad Nauseum

    Greetings
    I have a button that is a movie clip that is set up with animations triggered with MOUSE_OVER and MOUSE_OUT event listeners.  The glitch is that once the mouse is over the button ... each ensuing pixel that the mouse is moved, loops the animation again.  That probably didn't make a whole lot of sense, so I posted the file on my test site (http://www.savagepixels.com/test/test.html).  You have to drag your mouse slowly across the button to see this. The bottom part of the button works as I'd expect.  When you roll over the text at the bottom of the button, everything functions as it should.  The looping problem starts when you roll over the image portion of the button.  For some reason it considers each consecutive pixel rolled over to be a new event and consequently triggers the "over" animation again.
    The code I have is below.  I've commented out the MOUSE_OUT function for now.  There is also a screenshot at the above link of my Layers palette for the button clip in question.  I put a "stop" label at each frame that has an action so you see the actions used.
    Thanks for helping!
    oneBedButton_mc.buttonMode = true;
    oneBedButton_mc.addEventListener(MouseEvent.MOUSE_OVER, overEffect);
    //oneBedButton_mc.addEventListener(MouseEvent.MOUSE_OUT, outEffect);
    function overEffect (e:MouseEvent)
        oneBedButton_mc.gotoAndPlay("over");
    function outEffect (e:MouseEvent)
        oneBedButton_mc.gotoAndPlay("out");

    That was helpful. I had one of images in the button movie clip that wasn't a movie-clip type symbol ... it was just a static .png image.  Once I converted that into a movie clip, the repetitious looing went away.
    There is still some weirdness if you refresh that same link ... (http://www.savagepixels.com/test/test.html) if you roll over the lower part of the button where the text "One Bedroom + Study" is, and then move your mouse up over the image portion, the whole MOUSE_OVER event gets triggered again.  This is weird because there are no actions whatsover in the button movie clip except a few stop(); keyframes.  It treats the image as a separate button.  Any ideas on what is causing that event to be triggered in this way?

  • How do I stop a movie clip from looping

    I am using Action Script 3 and the 'stop()' function is not working to stop my movie clips from looping continuously.
    I have added the 'stop()' function to the last frame on the timeline of each movie clip.
    I originally built the .fla file in Flash CS6 using Action Script 2 where it was working with no problems (I have since upgraded and don't have access to CS6 anymore).
    I have all the separate movie clips positioned on Frame 1 of my main stage with the following script to start them playing:
    Cigarette_Reveal.play();
    KickTheHabit.play();
    BallMove.play();
    BallFlip.play();
    Offer.play();
    I want each of these movie clips to stop playing after one animation sequence is complete.
    Please help!

    Turn on strict mode in your publish settings. This will allow you to see the compiler errors that are preventing the actionscript in your fla from compiling correctly.

  • Assigning names to movie clips in loop

    hey, sorry if this is double post...
    im trying to run a loop and assign all my new movie clips
    with different names. i have tried .name and ._name they dont seem
    to be working... any help is appreciated.
    for (var i = 1; i<=5; i++) {
    imageName = new ImageMovie();
    this.addChild(imageName);
    so how do i make imageName something like imageName1,
    imageName2, ...

    Depends on what you mean by "name". If you mean the actual
    Object Name (), I don't think you'd like to rename that anyhow, but
    changing the property "name" of the Object is easy:
    for(var i=1; 1<=5; i++){
    image = new ImageMovie();
    image.name = "imageName" + i;
    this.addChild(image);
    Now you can access your 5 imageMovie instances by referencing
    their name property, as in getChildByName(imageName1);
    Any help?

Maybe you are looking for