Help with Loadmovie...(especially from upuaut8)

Hi,\r\rI have read a few threads on loadmovie and loadmovienum, but I don’t get it…hoping to get some help here.\r\rThis is what I want to do…really simple\r\rLets say this is the flash movie 600 by 400 pixels\r------------------------------------------------\r| A Bunch of | When I click a menu button |\r| Menu Buttons | the correspodning SWF file |\r| Here | loads up here…when I press |\r| | another button the first one |\r| | unloads and second one loads |\r-------------------------------------------------\r\rThat’s about it…I know how to make buttons, if I am right\rI guess I could also keep flags to check which movie is \rloaded and when another button is pressed, unload the movie\rthat’s there…but my problem is…how on earth do I get\rloadmovie to work in the first place?\r\rcould someone explain the process with a simple example…would be grateful…\r\rwould really really appreciate it…\r\rthanks.

ok when i posted it the box i made got all jumbled up…\r\rso this is what i wanted to say…a menu on the left hand side and whenever i press a menu button a SWF loads on the right hand side of the menu…when another button is pressed the first SWF unloads and in the same place the second SWF loads…\r\rplz help

I’ll write up what I can tonight.

ok well first off in your possition you wont need to unload anything. If you load something into a movie clip or a level, then load something else into the same movie clip, or the same level, it will push out whatever is there.\r\rloadMovie(); is my favorite. I usually use this because it lets me load an external swf into a target movie clip.\r\rthe syntax for a button execution of the code is pretty easy.\r\ron(release){\r loadMovie(“","myMovieClipHolder”);\r}\r\rthe loadMovie command takes two arguements, loadMovie(d,e);\r\rd being the url of the movie that’s being loaded, which must be on the server that holds this swf. Note… if the swf that is doing the loading, and the swf that is being loaded are in the same file folder, you can just enter in the name of the swf to be loaded as a local address. You don’t need to include the “http://…” etc. This is useful. If you are doing a test on your computer, just make sure that you’ve published the other movie, and placed the swf file in the same place as the FLA that you’re working on. Then use local addressing and the test will load the files on test.\r\re being, the “instance” name of the movie clip that you’re loading this swf into. Remember the instance names… it’s 90% of the reason why these things don’t work. If this doesn’t work, check the instance name of the target holder clip against the loadMovie script.\r\r---------------------------------\rThere is a little detail to mention. A movie clip has a registration point of it’s upper left corner. When you load an swf into a movie clip, it’s center will be in the upper left corner of your holder clip. As long as you know that this is happening, you can compensate in your movie.\r\rPS, once an swf is loaded from the server, it goes into the computer’s cache. Return visiting to the movies should be almost instantanious.

oohhh okkk…now that really helped. Thanks a million upuaut8.\r…but one more question…if my target “movieclipholder” is 200x200 and the movie i am loading into it is also 200x200…then how do i compensate for the alignment??\r\ror do i have to make the movie I am loading in 800x800 and use the lower right 200x200 of it for compensation…i don’t get the compensating part.\r\ri got the loadmovie to work fine…thanks again…but the its positioning is all messed up…plz help. thanks.

positioning is pretty easy to deal with, but it throws off my align panel. What I really need is an align button that will align an objects upper left corner to the center of the stage. In lew of that, I use guides to create a center point.\r\rWhat you have to do to solve the offset is; in the movie you are creating to be loaded, you must offset your object so that it’s upper left corner is located at it’s centerpoint. During construction in Flash, it’s the center of the stage.\r\rThere is a secondary method of course. If you create the holder clip to contain something, which is the same size as the movie that you’re loading into it, then you can offset this object instead. This method is good if you’re making lots of text fields to be loaded into a movie, or a lot of pictures that you’ve cropped to be the same size.\r\rI’ve use either of these methods depending upon the project I was working on.\r\rNow there is an action script solution as well. The onClipEvent(data){} handler invokes it’s script when data is finished being loaded from a server. If you were to have pics of differing sizes, loaded into a blank movie clip then you could do something like the following,\r\ronClipEvent(data){\r _x=-_width/2;\r _y=-_height/2;\r}\r\rI’ve never tried that mind you, but it’s logicaly sound.\r\rAnd that is why I love doing this job. Answering a question, is often the best way to learn how to do something. The last example is a/s and will be the easiest to include in new projects that you make. I’ll be trying that out tomarrow so I’ll let you know if I fix any bug that it might have.