dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] SetInterval not working correctly with Scenes

Hybrid View

  1. #1
    Member
    Join Date
    Dec 2007
    Posts
    71

    resolved [RESOLVED] SetInterval not working correctly with Scenes

    Hi, I've created a flash (see attached)... There are 7 individual Scenes.

    The first scene will have an embedded movie clip and artwork as a background for approximately 150 frames, the next scene (Scene 2) then appears (in the first and only frame) which has the following (AS2) setInterval on it (to play a swf file on a movie clip - the swf lasts a little over 2 minutes. Hence, 122000 milliseconds below):

    Code:
    mc_demos.loadMovie("swf/aquira.swf");
    stop();
    
    function pauseIt () {
    nextFrame();
    clearInterval(advScene);
    }
    
    advScene = setInterval (pauseIt, 122000);
    Scene 3 is supposed to repeat a new type of animation like the intro(scene1) for approx. 150
    Scene 4 is a new demo that that is supposed to play on a movie clip on 1 frame and lasts about 51 seconds, so I tweaked the SetInterval.
    Scene 5 - the next animation 150 frames
    Scene 6 is supposed to be the last SWF demo (also has a custom timed setInterval code on 1st frame)
    Scene 7 is a still.

    The problem is that I am successful in going through the scene 1, and automatically advancing to scene 2. Also successful in the setInterval executing and pausing to allow the Movie clip to play the loaded SWF, but after the swf finishes, it only advances to the scene 3 and just sits there. I'm guessing that this means that there is something wrong with the SetInterval clearing. Am I correct in this assumption. I tried a barage of tweaking, moving scenes, taking code of, putting it on the actual Movie clip, but I still am not having any luck. I know that it is probably something so simple. As, I wear myself out with trying to debug code and then tend to overlook something so simple.

    A set of different eyes taking a look at it would make me very grateful.

    Thanks in advance. (file [in CS3 & FLA8] can be downloaded from the link below. *Place holders are on the stage except for where/when the SWFs play. I did not include SWFs for file-size sake).

    http://www.yousendit.com/download/Yk...Zy90NjlFQlE9PQ


    AC

  2. #2
    Member
    Join Date
    Dec 2007
    Posts
    71

    SetInterval not working correctly with Scenes - UPDATE!

    I have finally figured this out!

    For anyone interested, who may have had the same problem:

    Here's what I had originally started out with:

    Code:
    mc_demos.loadMovie("swf/aquira.swf");
    stop();
    
    function pauseIt () {
    nextFrame();
    clearInterval(advScene);
    }
    
    advScene = setInterval (pauseIt, 122000);
    And I realized that I needed to cause the following scene to play (not to only just advance to next frame - so I changed the method (in the pauseIt function) to play(); -- Sometimes, it's the simplest of things...

    Hope this helps someone.

Tags for this Thread

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