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

flash actionscript

group:

Loading movie from movieclip


Re: Loading movie from movieclip pngatlin
7/31/2005 12:00:00 AM
flash actionscript:
Loading movie from movieclip nsbrown
7/31/2005 11:06:52 AM
I need help with loading a movie from within another movie can anyone get this
loadMovieFile to work??

_level0.btnLoad.onRelease = function(){
_level0.mcEmptyClip01.attachMovie('movMovie01', 'mcMovie01', 0);

};
_level0.mcEmptyClip01.mcMovie01.btn01.onRelease = function(){
_level0.mcEmptyClip02.attachMovie('movMovie02', 'mcMovie02', 0);

};
Re: Loading movie from movieclip Rothrock
7/31/2005 6:01:24 PM
I don't see and loadMovie in the code you have given.

attachMovie works with clips that have been included in the library and set to
export for actionscript.

So what are you trying to do, attach a movie from the library or load an
external movie?

BTW, if you are trying to load an external file and you are using MX04, I
really recommend the MovieClipLoader class. Check it out in the help files.
Re: Loading movie from movieclip nsbrown
7/31/2005 6:50:51 PM
I'm attaching the movieClip 'movMovie01' from the library into 'EmptyClip01'
and within that movie I have a button to load 'movMovie02' into my
'EmptyMovieClip02'. both EmptyClips on are on the stage.
Attaching 'movMovie01' loads fine but when I try to click on the button within
that it doesnt work.

Make any sense?
Re: Loading movie from movieclip digital_monkey
7/31/2005 9:10:53 PM
It could be because ActionScript is asynchronous, meaning that it doesn't wait
for an operation to finish before it starts on the next one. It's possible that
Flash is attempting to define the onRelease command before the clip has loaded
onto the stage. Try nesting the onRelease function inside an onLoad handler:



_level0.mcEmptyClip01.mcMovie01.onLoad = function(){

_level0.mcEmptyClip01.mcMovie01.btn01.onRelease = function(){
_level0.mcEmptyClip02.attachMovie('movMovie02', 'mcMovie02', 0);

};

};
Re: Loading movie from movieclip nsbrown
8/1/2005 12:00:00 AM
Re: Loading movie from movieclip digital_monkey
8/1/2005 6:12:11 PM
Don't know why that way isn't working, but the problem still is that you are
trying to assign an onRelease event handler to an object that hasn't been
created yet (since you need to press btnLoad for the mcMovie01 to exist).
Here's the solution:


_level0.btnLoad.onRelease = function() {
_level0.mcEmptyClip01.attachMovie('movMovie01', 'mcMovie01', 0);

_level0.mcEmptyClip01.mcMovie01.btn01.onRelease = function() {
_level0.mcEmptyClip02.attachMovie('movMovie02', 'mcMovie02', 0);
};

};
AddThis Social Bookmark Button