Created SWF now to load into new SWF

Posted on 2005-04-10
Last Modified: 2010-04-03
I created my swf it all works .

Now i created brand new movie
added MC_EMPTY which i called instance of Empty

has nothing in it...

in first frame added


But it does not continue it will get stuck on the part
where it trying to return.

I thought if you created a swf...........(then it is all inside here and when i call it ...(this should work)

Any suggestions.
Question by:TRACEYMARY
    LVL 27

    Assisted Solution

    I gets stuck because the absolute path to the movie root points now to the empty loading movie root.

    1. solution (if you are exporting for flash player 7):

    Empty._lockroot = true;

    2. solution


    3. solution

    use relative path
    LVL 7

    Author Comment

    It worked with solution one.............
    not sure about where i would put solution 2.....

    relative paths...........can you help me understand so i get this right for my other swf i created
    LVL 9

    Accepted Solution

    Hi I'm hoping that I got the question right...

    This is what I think you want.....
    - You created a main movie
    - In the main movie you created an empty movie clip
    - Then you load the shelter_g.swf into the empty movie clip
    - In shelter_g.swf you added a frame called resume
    - From the main movie you now want to make shelter_g.swf
      go to the resume frame and paly?

    Here is how you do it:
    // Solution 1:
    // In your main movie create an empty movie clip using ActionScript (I hate doing things manually :)
    // In this case I call the empty movie container since it's about to store your shelter_g.swf
    container = createEmptyMovieClip("container",0)

    // Now use the loadMovie function

    // Call the gotoAndPlay without the " " as you did

    But wait a second...  let's try take a little more control over the process.  Lets be sure only to call the
    gotoAndPlay(resume) when the shelter_g.swf is loaded.

    // Solution 2:
    // Create the empty conatiner as before
    container = createEmptyMovieClip("container",0)

    // Now create a load listener. This is an object that monitors the load and can be asked to inform us
    // when it starts to load, when loading or when done loading etc. - Read more in the flash help MovieClipLoader.
    var loadListener:Object = new Object();

    //  I'll only show how to use the onLoadComplete function, a function that repports when our movie has loaded.
    // We ask the loadListener to report a load complete situation by executing the .gotoAndPlay(resume)
    loadListener.onLoadComplete = function(target_mc:MovieClip) {
      // The target_mc in this case will be our "container"

    // Having asked our loadListener to look out for a loaded movie let's give it something to work with
    // Instead of using the loadMovie we use the more advanced MovieClipLoader that allows us to add
    // our loadListner to monitor the process.
    var mcl:MovieClipLoader = new MovieClipLoader();

    // Having created our MovieClipLoader we now assign our loadListener

    // Well now we are ready to start the load by adding the file to load and the target movie clip.

    Best, Jakob E

    LVL 7

    Author Comment

    That was a great lot of information.

    The resume was in the shelter_g.swf (this just happens in side the swf).

    It was just getting stuck on first......main movie. this worked below.
    Empty._lockroot = true;

    The main movie does not need to go to the resume in shelter_g.swf it just need to play.

    Let me lot at the container thats useful information

    Thanks all

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
    I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
    The goal of the tutorial is to teach the user how to how to record live broadcast.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    760 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

    8 Experts available now in Live!

    Get 1:1 Help Now