Waiting for a movieClip to finish

Posted on 2005-04-22
Last Modified: 2008-02-01
Hi there.

--- THE STATUS ---
I've build a flash app with two main modules:
- First is the front-end. It just includes backgrounds, buttons and an empty movieClip to load whatever to be displayed.
- Then there are n tiny SWFs that will be loaded dinamically when the user clicks on the front-end buttons.

Each one of these tiny SWF includes a transition effect before displayed (unrolling), then show the contents (and stop), and a rolling effect to do before unloading.

--- THE CODE ---
this["button" + i].onRelease = function () {
  content.gotoAndPlay(3);  // starts the ending animation
  loadMovie("new-movie-to-load.swf", content);
// Tip: content is just an empty mc used to load all the SWFs to be shown.

The rolling effect is never show, because of (i guess) it's unloaded before ending the execution. How can i wait for the SWF movie to finish before unloading it?
Question by:Kkto
    1 Comment
    LVL 18

    Accepted Solution

    check for the last frame of that mc, or put the call to unload the next mc in the loaded swf.

    With the second option - not sure how unloading works from a loaded swf, so you can do this - on last frame of the loaded swf, put this:


    then check for that in your code:


    with first option,  put this in your code


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
    The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
    The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now