all groups > flash actionscript > january 2007 >
You're in the

flash actionscript

group:

loadMovieNum action


loadMovieNum action dijonadobe
1/27/2007 9:24:01 PM
flash actionscript:
Please help!
I'm not an action scripter, more of a visual artist.

I'm trying to use the loadMovieNum action to load an external .swf file into
my Main Movie. It loads -- but it doesn't
conform to size and location property values. Was under the impression that
when the loadMovieNum action was used your movieclip place holder would be
replaced with your loaded external movie file and would assume/retain the
property values of the movieclip place holder. What am I missing?

Also tried to Set Properties: W,H, X,Y -- still no luck.

Online user tried tohelp in the past with the suggestion to use preloader code
or the onLoadInit() method of the moviecliploader class. I'm not familiar
with this.

Please, can someone help me with this?
Thank you so much.
Re: loadMovieNum action kglad
1/27/2007 9:41:41 PM
loadMovieNum() does not load into a place holder movieclip. it loads into a
_level. you can still control its _x,_y,_width,_height properties but you must
wait until loading is complete to do so.

with loadMovie() you can load into a target (or place holder) movieclip. you
can control the _x,_y properties of the target prior to load completion.
however, to control the _width, _height properties you must wait until loading
is complete.

if you want to use the moviecliploader class you would use loadClip and load
into a target movieclip or a _level. again, with a target movieclip you can
specify _x, _y properties any time (after the target movieclip is created) but
to specify _width,_height properties you must wait until loading is complete
(and the movieclip is initalized) as in the onLoadInit() method of a
moviecliploader's listener.

now, for specific help: do you want to load into a _level or a target
movieclip?
Re: loadMovieNum action dijonadobe
1/27/2007 9:54:27 PM
Thank you for commenting so fast.
Please have patience with me -- not so smart when it comes to scripting.
I believe I want to use the loadMovie() in order to target a place holder
movie clip.
I'm OK with waiting until movie loads to change the _width, _height properties.

Let me try some scripting to see what I encounter.
Thanks.
Re: loadMovieNum action kglad
1/27/2007 10:09:31 PM
if you're going to use loadMovie() (instead of using the moviecliploader
class), you'll need to use preloader code to ensure your external .swf has
completed loading before you try and control its _width and _height properties.
for example:



this.createEmptyMovieClip("targetMC",1);
targetMC._x=whatever; // this can be defined any time. you need not wait
until loading is complete.
targetMC._y=whateverElse;
targetMC.loadMovie("exteranlSWF.swf");
preloadI=setInterval(preloadF,100);
function preloadF(){
bl=targetMC.getBytesLoaded();
bt=targetMC.getBytesTotal();
if(bl>0&&bl>=bt){
// loading is complete
clearInterval(preloadI);
targetMC._width = whateverWidth;
targetMC._height=whateverHeight;
}
}
Re: loadMovieNum action dijonadobe
1/27/2007 10:23:34 PM
Oh gosh! I think I'm in over my head.
Do I really have to use the preloader scripting? My movie loads fast!!
What is the easiest method you recommend? (it's all probably easy for you)
I think I'm tryind to do something without complete comprehension. I get
excited because my movie is loading just not in the size or where I want it.
Re: loadMovieNum action kglad
1/27/2007 10:35:08 PM
the easiest is either above (but spell externalSWF.swf correctly) or use the
moviecliploader class. i'm not sure that's easier, but here's what it would
look like:



lo=new Object();
mcl=new MovieClipLoader();
lo.onLoadInit=function(target){
target._width=whateverWidth;
target._height=whateverHeight;
}
mcl.addListener(lo);
this.createEmptyMovieClip("targetMC",1);
targetMC._x=whatever; // this can be defined any time. you need not wait
until loading is complete.
targetMC._y=whateverElse;
mcl.loadClip("externalSWF.swf",targetMC);
Re: loadMovieNum action dijonadobe
1/27/2007 10:50:31 PM
I tried your first suggestion.
I just read your other post.
hmmm...for your quotations I've been putting in the actual name of my external
file -- is that not correct?
I guess I'm supposed to actually type in ("exteranlSWF.swf") (with external
typed correctly).

The movie loaded -- still not the right size or location -- but in a different
location.
hmm....

Re: loadMovieNum action dijonadobe
1/28/2007 12:43:48 AM
AddThis Social Bookmark Button