all groups > flash actionscript > december 2005 >
You're in the

flash actionscript

group:

Problems with loadMovie in to a path


Problems with loadMovie in to a path NewMediaRoc
12/31/2005 8:50:59 PM
flash actionscript:
I'm having a problem with actually loading images in with the loadMovie()
function. When I try using the following code, only the last of the seven
images show up. When I change the path to simply _root, all of them show up...
I really need this image to have a certain parent for masking purposes. Is
there something wrong with my code? if not, is there a way I can load these
images and then target the path separately?

_root.contentArea.createEmptyMovieClip("images",getNextHighestDepth());
for (var i = 0; i<7; i++) {

_root.contentArea.images.createEmptyMovieClip("pic"+i+"_thumbnail",getNextHigh
estDepth());

loadMovie(data_obj[menuChoice.myText.text][0]["thumbnail"],_root.contentArea.i
mages["pic"+i+"_thumbnail"]);
var mc=_root.contentArea.images["pic"+i+"_thumbnail"];
mc._x=(bigTL[0]+10+(i*((bigTR[0]-bigTL[0]-11)/7)));
mc._y=60;
}

Re: Problems with loadMovie in to a path kglad
12/31/2005 9:52:12 PM
the code you've shown only executes the loadMovie() function 7 times. why would you expect more than 7 images to be loaded?

Re: Problems with loadMovie in to a path NSurveyor
12/31/2005 9:56:15 PM
Also, you've misused getNextHighestDepth...

_root.contentArea.createEmptyMovieClip("images",_root.getNextHighestDepth());


_root.contentArea.images.createEmptyMovieClip("pic"+i+"_thumbnail",_root.content
Area.images.getNextHighestDepth());
Re: Problems with loadMovie in to a path NSurveyor
12/31/2005 10:01:31 PM
Sorry, for first one, should be:

Re: Problems with loadMovie in to a path kglad
12/31/2005 10:14:07 PM
check ns comment. getNextHighestDepth() is returning a number (the next
highest depth on the timeline that contains that code). but the newly created
movieclips are being placed at that depth on a different timeline so when
getNextHighestDepth() subsequently executes the same number or depth is
returned (because no movieclip has been added to that depth on that timeline).
Re: Problems with loadMovie in to a path NewMediaRoc
1/1/2006 7:52:54 PM
I'm got a new problem cropping up. These images that are loaded up need to
actually become buttons. so I added some code:

contentArea.createEmptyMovieClip("images",
contentArea.getNextHighestDepth());
for (var i = 0; i<7; i++) {
contentArea.images.createEmptyMovieClip("pic"+i+"_thumbnail",
contentArea.images.getNextHighestDepth());
var mc = contentArea.images["pic"+i+"_thumbnail"];
mc._lockroot = true;
loadMovie(data_obj[menuChoice.myText.text]["thumbnail"], mc);
mc._x = (bigTL[0]+10+(i*((bigTR[0]-bigTL[0]-11)/7)));
mc._y = 60;
Mouse.addListener(mc);
mc.onRollOver = function(){
trace("rollover");
}
mc.onRelease = function(){
trace("release");
}
}

but when I mouse over, or click on the images, no trace statements happen. Is
there something wrong with my code? perhaps something that causes conflicts
when the images are placed in container movie clips?
Re: Problems with loadMovie in to a path kglad
1/1/2006 8:06:06 PM
that Mouse.addListener() statement is unneeded. and you can't define mouse
handler's for those movieclips until loading is complete: use preloader code
to determine when loading is complete and then define the handlers.
Re: Problems with loadMovie in to a path NSurveyor
1/1/2006 9:03:28 PM
You could do this, so you don't need a loader..

this.createEmptyMovieClip('a',0);
a.createEmptyMovieClip('b',0);
a.b.loadMovie("hapiness.swf");
a.onRollOver = function(){
trace("HAPPY!");
AddThis Social Bookmark Button