dcsimg
A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: [CS3] Playing several MCs in succession

  1. #1
    Junior Member
    Join Date
    Nov 2008
    Posts
    6

    [CS3] Playing several MCs in succession

    Hi, PLEASE HELP, this is for a university project!

    I have 5 movie clips each with about 200 frames, that end in a loop. Each of these are working fine individually.

    The problem is:
    I want to put them all into the one scene, with the first frame of each showing.
    The first one will play through, then will finish (with the loop still playing).
    I then want the second to start automatically, play through, and finish with the loop, and so on, until all five have played through, and all the loops are running.

    This is seriously destroying my brain, I've played around with converting them to graphic symbols, putting actionscript in the symbols and in the scene, but I just can't get it to work beyond the first.

    PLEASE HELP!!!!

  2. #2
    Junior Member
    Join Date
    Nov 2008
    Posts
    6
    ok, i cheated and just copied the frames from each MC into the one scene. it's not as elegant as i was hoping for, but it works
    i'd still be interested to know how to do it the way i was describing though, if anyone knows?

  3. #3
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    I set up a variable to track a number and a function to add to that number. Then just place in a conditional statement to play your additional movies when a certain number is reached (c2 was my second mc).
    PHP Code:
    c2.stop();

    var 
    frameCount setInterval(addNum5000);
    var 
    record:Number 0;

    function 
    addNum() {
        
    record record 1;
        
    trace(record);
        if(
    record == 2) {
            
    c2.play();
        }

    HTH.
    Wile E. Coyote - "Clear as mud?"

  4. #4
    Junior Member
    Join Date
    Nov 2008
    Posts
    6
    oh thank you, that's beautiful!

    though i was just wondering what is the "5000" a measure of? i changed it to 1000 just because the length of the mcs vary slightly and i could go

    if(record == 16) {
    c3.play()
    }
    etc.

    it works well, but i was just interested what unit of time is being measured

  5. #5
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    5000 was the time in milliseconds, so basically 5 seconds. The lower the value the sooner the setInterval functions runs.
    Wile E. Coyote - "Clear as mud?"

  6. #6
    Junior Member
    Join Date
    Nov 2008
    Posts
    6
    eeek!
    it was working so well (thank you!) but then i realised if i return to the frame where the interval code is, it goes faster and faster. is there a little bit of code that will stop the interval counting when i don't need it anymore and restart from 0 when i go back to it?

    thank you so much

  7. #7
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    To stop a setInterval function just use clearInterval("interval name");
    Wile E. Coyote - "Clear as mud?"

  8. #8
    Junior Member
    Join Date
    Nov 2008
    Posts
    6
    ah fair enough

    ...and in my case, if i've copied the code from above, the name of my interval is...?

    sorry to be so hopeless, i'm a designer, not a programmer hehe

  9. #9
    Junior Member
    Join Date
    Nov 2008
    Posts
    6
    ah... framecount

    thanks so much for all your help with this, rob!
    LEGEND!!!!!!!!

  10. #10
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Glad you got it working.
    Wile E. Coyote - "Clear as mud?"

  11. #11
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Glad you got it working.
    Wile E. Coyote - "Clear as mud?"

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