Loading an .swf into a blank mc. how?

hello there. i can’t seem for all my reading and prodding figure out how to load an external .swf into a placeholding mc. is this possible? or am i using a hammer to type? i would greatly appreciate any help.

self deprecating humor: there are no stupid question, but there are lots of inquisitive idiots.

thanks!

Welcome to the forum orome !

Yes, this is possible. It’s used very much actually. Simply use

[AS]
_root.placeholder.loadMovie(“http://www.yourserver.com/movie.swf”);
[/AS]

:wink:

Voetsjoeba, does it work with the absolute URLs? I thought that was a security thing with flash and that you can only use relative URLs.

EG: Yes it works with both absolute and relative URLs, but the files must be viewed and run from the same server. Otherwise you would need to use the LocalConnection object and it’s allowDomain property. I tried that and couldn’t get it to work, but I didn’t try very long either :stuck_out_tongue:

thanks!

i found something in one of the other post that worked…sorta

onClipEvent(load){
loadMovieNum (“photoslide.swf”,1);
}

but it’s not loading it in the right place…

thoughts gentlemen/women

loadMovieNum loads to a level loadMovie loads to an empty clip.

You can also try something like this like how lost stated and also define where it’s going to show up on stage:[AS]onClipEvent(load){
_root.createEmptyMovieClip(“emptyMC”, 1);
_root.emptyMC.loadMovie(“photoslide.swf”);
_root.emptyMC._x = 145;
_root.emptyMC._y = 120;
}[/AS]
That creates a empty movieclip with an instance name of “emptyMC” and it will load photoslide into emptyMC. It will also place emptyMC on those x and y cordinates. Just play with the numbers till you get it where you want it.

Also keep in mind that x = 0 and y = 0 would be the top left corner of your movie.

tried just loadMovie but it is positioning wrong. how do u force your new movie to the right coords.

sorry bout the noobness.

u guys are too quick…
posted b4 read.

Why the onClipEvent EG? Why not just throw it on a frame?

[AS]this.createEmptyMovieClip(“emptyMC”, 1);
this.emptyMC.loadMovie(“photoslide.swf”);
this.emptyMC._x = 145;
this.emptyMC._y = 120;[/AS]

And just to be annoying…

[AS]this.createEmptyMovieClip(“emptyMC”, 1).loadMovie(“photoslide.swf”);
this.emptyMC._x=145, this.emptyMC._y=120;[/AS]

you guys rock. bows lowly

*Originally posted by orome *
**you guys rock. bows lowly **

bows to beta :stuck_out_tongue:

bows to everyone

LOL lost you’re retarded. :stuck_out_tongue: ahha that just made my day. :stuck_out_tongue:

A little addition: use a high number for the depth. There could be an mc already there, so a high number will prevent the new mc from overwriting the old.

Yeah, that’s a good safety precaution :thumb: I usualy create the clip at level 10000 instead of 1.