Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

Created SWF now to load into new SWF

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

Empty.loadMovie("shelter_g.swf");

But it does not continue it will get stuck on the part
_root.empty_shelter.newname_shelter.gotoAndPlay("resume");
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.
0
TRACEYMARY
Asked:
TRACEYMARY
  • 2
2 Solutions
 
negatyveCommented:
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;
Empty.loadMovie("shelter_g.swf");

2. solution

_root.Empty.empty_shelter.newname_shelter.gotoAndPlay("resume");

3. solution

use relative path
0
 
TRACEYMARYAuthor Commented:
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
cheers
0
 
Jakob_ECommented:
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
loadMovie("shelter_g.swf",container);

// Call the gotoAndPlay without the " " as you did
container.gotoAndPlay(resume)




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"
  target_mc.gotoAndPlay(resume)
};

// 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
mcl.addListener(loadListener);

// Well now we are ready to start the load by adding the file to load and the target movie clip.
mcl.loadClip("shelter_g.swf",container);




Best, Jakob E


0
 
TRACEYMARYAuthor Commented:
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;
Empty.loadMovie("shelter_g.swf");

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
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now