Load movie problem (yeah, me too)

Iā€™ve made a flash-menu, menu.fla, and now I want to load it into the ā€œmainā€ flash-movie. Iā€™ve made an empty movieclip, named it menuMC, and added this script,

onClipEvent ( load ) {
&nbsp &nbsp &nbsp &nbsp loadMovie (ā€œmenu.flaā€, menuMC);
}

but it wont happen.
the menuMC is equally big as the menu.fla but Iā€™m a bit unsure what to put into the menuMC. It has to be something, right? I tried just making the stroke and leave out the fill in case menuMC somehow was infront of the loaded movie but that wasnā€™t it. Iā€™ve read plenty of tutes but I canā€™t wrap my head around them. It really shouldnā€™t be that hard, Iā€™m confused.

The main movie and the menu.fla is in the same dir on my HD.

Suggestions?

Thanks

Achnor

You have to publish the fla, into an swf, and then use that swf name in the loadMovie command.

Yes! Thank you. Problem solvedā€¦

Achnor

yep thatā€™s where I went wrong!!! I was trying to load file.html, not file.swf :slight_smile:

I hate asking these stupid questions when Iā€™m certain there is an easy explanation, if nothing else, it keeps you occupied :wink:

Ok. I can see the loaded movie now, but that is also all that is visible? Iā€™ve got other stuff in the movie too (on different layers) but all I can see is the inserted movie? Maybe I thought wrong. What I wanted to do was to incorporate several ā€œsmallerā€ movies (like an anomated logo, a menu, a vertical menu) into one big final movie, these sub-movies running independently from each other. Is this possible?

Also, I would like to control the size and position of the inserted movies. Maybe this will become clear if someone can educate me regarding my first problem.

Thanks

Achnor

You can load multiple movies by loading them to different levels/targets.

I donā€™t know about the resizingā€¦ Maybe if you load the movie inside a MovieClip and then set property of the MovieClip (_root.MovieClip._yscale, _root.MovieClip._xscale)

Tough Iā€™m not sure if itā€™ll workā€¦

Yes it willā€¦ in fact, the loaded movie will take on any transformations which have already been set on the clip youā€™re loading it into.

possitioning is based upon the upper left corner of the movie clipā€¦ so, if you had a movie clip called ā€œholderā€ and you loaded a movie into it, you could simply use action script to change itā€™s location, color, alpha, etc, in any number of the following ways. (note I use root here. this means that holder movie clip would be on the main timelineā€¦ if itā€™s located elsewhere then youā€™ll need to address it differently.)

_root.holder._alpha=50;
_root.holder._y=0;
_root.holder._y=0;
_root.holder._yscale=50;

This would set the movie clip to 50% alpha, set it in the upper left corner of the stage, and scale itā€™s width 50%.

Thanks, but it is still not working.

The loaded movie is not confined to the movieclip.
Iā€™ve tried several different things:

onClipEvent (load) {
&nbsp &nbsp &nbsp &nbsp loadMovieNum (ā€œmenu.swfā€, 1);
}

if I set the level to be 0, I will only see the loaded movie. If I set it to 1, I can see everything, but the menu is sort of ā€œon topā€ of the movieclip, not inside it.

Iā€™ve also tried:
onClipEvent (load) {
&nbsp &nbsp &nbsp &nbsp loadMovie (ā€œmenu.swfā€, ā€œmenuMCā€);
}

where menuMC is the menu holder movieclip. Now I see everything except for the loaded movie.

The script you gave me regarding size and position works for the holder movie, menuMC but not the loaded movie, menu.swf. I guess that is because the menu.swf is not loaded in the menuMC clip. sigh this is getting complicated

My scenario: Iā€™ve made a movie-symbol, dragged an instance on the main timeline, called it menuMC, added the loadMovie-script to the clip. I have only one layer, and the menuMC is just a rectangle, nothing fancy. I try to make as basic as possible to find out where the mistake is but Iā€™m lost.

Thank you for your time.

Achnor

Check your instance panel. Make sure that the movie clip ā€œholderā€ has been given an ā€œinstanceā€ name. The name from the library will not work for those commands.

Yes, it is the instance that is called menuMC.

If I can ask you a favour. Could you make two movies, one with a big circle, one with a square. Load the circle into the square and resize it so it fits and send it to [email protected]. This way I can be sure that Iā€™ve put the actionscript in the rigt place etc. etc.

I know I ask much, I will also try to help out in the forums when I get better, I promise! :slight_smile:

Achnor

Yeah, no problem. I think that I can get that out to you tomarrow some time.

Are you entering the A/S on the MovieClip itself? (from the main stage). Because I think you need to put the actions INSIDE the MovieClip, on one of its frames (when editing the MovieClip).

Then you can try this:

loadMovie (ā€œmenu.swfā€, _this);
Stop;

But Iā€™m not sure itā€™ll workā€¦ Could give it a try toughā€¦

Just correcting syntax a little bit :
loadMovie (ā€œmenu.swfā€, this);
stop ();
is more likely to work. Still I donā€™t know if it will.

pom 0]

ok here it is and the associated downloads.

www.centerspin.com/downloā€¦Loader.swf

On thing to note, and the reason I left the cut out of the circle. The movie thatā€™s being loaded uses a registration point of the upper left corner of the movie, The movie clip that has stuff loaded into it, is blank, and therefore has a reg point of where ever it is. This means that the loaded movie is offset by itā€™s upper left corner. When you open the file youā€™ll see what I mean. The links to the zip with all orginals is here.

www.centerspin.com/downloā€¦Square.zip

I love you guys :slight_smile:

Looking at upuaut8ā€™s files I finally got it! Instead of doing a onClipEvent (load) { loadmovie etc. etc.) in the A/S of the movieclip, I did only a loadmovie (etc. etc.) in the A/S of the frame and it works! I also successfully applied the size/position formatting to the holderMC (in the holdeMCā€™s A/S) and the loaded movie changed accordingly!

Iā€™ve always read that the loadmovie() should be executed within the holdeMC but that would never work (with an onClipEvent). Doing it through the frame does. Donā€™t know why I couldnā€™t make it work the ā€œnormalā€ way but I donā€™t care, it works and I can manipulate it as seems intuitive.

Thank you very much!

Achnor

Iā€™ll see if I can figure out that method too. I think that Iā€™ve gotten it to work in the past with an onClipEvent(load){}

See? I told you to do it in the frame! :wink:

But itā€™s not in a frame INSIDE the movieā€¦itā€™s on the main timeline :stuck_out_tongue:

Achnor

ohā€¦ okā€¦