Skip to main content
Inspiring
February 6, 2007
Question

loadMovie to target issue

  • February 6, 2007
  • 14 replies
  • 153342 views
Sorry this is a cross-post but I need help pretty quick. Noone is responding in General.

I'm trying to load a external movie clip (600x450_test.swf) to a target (targ02) on the main timeline.

I have a clip on the main timeline which contains all my buttons. The script (below) is in the first frame of this clip.

The external clip loads but replaces the entire main movie all together.

I've been away from Flash for a few weeks but I thought this was what always worked. Not near old files to check.

Script here:

stop();

this.btn_Installingyt.onRelease = function(){
_root.loadMovie("600x450_test.swf", "targ_02");
};

System: FlashPro8, XP.
This topic has been closed for replies.

14 replies

May 7, 2020
Inspiring
February 6, 2007
you're welcome
Inspiring
February 6, 2007
ohh, the code is verry simple.

//this creates a MovieClipLoader called loader_mc
var loader_mc:MovieClipLoader = new MovieClipLoader();

//here you tell loader_mc to load the external content..
//which works the same way as you can see. ("your.swf","where to load in to")
loader_mc.loadClip("600x450_test.swf", "targ_02");
leodsmithAuthor
Inspiring
February 6, 2007
It really does. Thanks!
Inspiring
February 6, 2007
in your situation i would have:

this.btn_Installingyt.onRelease = function(){
gotoAndStop("loader_02");
};
BTW, you can use gotoAndPlay aswell.

then on the frame loader_02 have this code:

var loader_mc:MovieClipLoader = new MovieClipLoader();
loader_mc.loadClip("600x450_test.swf", "targ_02");

also, make sure you have the keyframe which contains targ_02 mc on the same frame as loader_02, but on different layers to avoid confusion..
eg: loader_02 is on layer 4 on frame 20...and targ_02 frame would be on layer 3 on frame 20.

hope this makes sense...its about 3AM here, and im struggling to keep my eyes open...
leodsmithAuthor
Inspiring
February 6, 2007
Guess I mean gotoAnd Stop, right?
leodsmithAuthor
Inspiring
February 6, 2007
Sorry I'm a bit of a simpleton and am not familiar with that script. Although I'd like to understand it and be better.

When you say "frames" you mean just using gotoAndPlay?

No place to upload my file right now.
Inspiring
February 6, 2007
In the live docs under “loadMovie” it mentions;

“A reference to a movie clip object or a string representing the path to a target movie clip. The target movie clip is replaced by the loaded SWF file or image.”

This makes sense leodsmith, because that is happening when I test my FLA.

Yes, I also recommend what Sketchsta posted last.
leodsmithAuthor
Inspiring
February 6, 2007
Thanks myIP.

I have used loadMovie into target clips for years with success. But I understand your theory and it's a good one.

I really like to keep timelines pretty simple and clean. Do you have any suggestions for a timeline "neat freak" using this way of loading externals?
Inspiring
February 6, 2007
I always use frames to load external content.. for example:

var loader_mc:MovieClipLoader = new MovieClipLoader();
loader_mc.loadClip("600x450_test.swf", "targ_02");

this way i keep all loadings separate, and all i need to do is send the playhead to the frame i want loaded.
leodsmithAuthor
Inspiring
February 6, 2007
loadMovieNum("600x450_test.swf", 2);

--- Loads the movie to level 2, but not where I want. That's why I need to load at my target (target_02) location.

My script works fine when it's on the main timeline, just not from with my menu clip.