Loading an external movie through an external movie to the main movie

I hope I can explain this well enough for someone to understand…Here it goes

I am creating a full site in flash. The main movie has an empty movie clip in the middle of the movie to load external movies as the user clicks on the links. Everything has worked good so far as the linking has only gone 1 level deep. However, when I created a new external movie, and had buttons on it for another external page, but yet to open in the main movie, I can’t get anything to work. Example… In the main movie, the user clicks on the archive link, and the external archive movie is loaded into the main movie. Now, on this archive movie, there is a button on it that links to a another movie (say text effects.swf). However, when they click this button for text effects, I can’t get it to load into the main movie clip and replace the archive movie that was currenlty there. Can anyone help me figure out how I need to go about doing this?

I hope I have been pretty clear on my problem. You can always visit www.davidgreer.home.dixie-net.com to see the movie and how it works. I can always post the .fla if I need to.
If anyone can help, please let me know. Thanks.

Hi
Sounds like a pathing prob to me. can you post your code for the
text files button, or better still your fla.

SteveD

Sure, I would be glad to post the fla. Only thing is, which fla do you need me to post? The main movie where everything loads is 479KB. The external file “archive” in which the buttons are located is 22KB and the destination external movie to load in the main movie “preloader1” is 11KB. I’m not sure that these are small enough to attatch. If not, maybe I can work something else out.

Thanks for responding.

David

Hi,
Post the code that is on your text file button, the prob is probably there

SteveD

Ok…I am going to go ahead and post the .fla also…but a quick view of what the code on the button is…

on (release) {
Website-Experiment.content_show.loadMovie(“preloader1”, play);
}

Ok, explanation here…the main movie is “Website-Experiment.swf”. Inside the main movie I have an empty movie clip with an instance name of “content_show”. Preloader1 is the external movie I am trying to load in the main movie. I know the code is way off…that was just the last line of code i tried on the button after experimenting with different code.

I hope some of this helps.

David

Hi,
Try this:
[AS]
_root.content_show.loadMovie(“preloader1.swf” 1);
[/AS]

and if you have stop action on the first frame of preloader.swf, take it of

Cheers

SteveD

Hello SteveD.

Thanks so much for the code. I haven’t tried it yet but I will very soon. But one thing…can you explain the code to me and why it works? I’ve been working with flash for about 1 year now, and i’m trying to learn as much about it as I can. Once again thanks, and I will let you know if it works or not.

David

Well, I have just tried it, and it works! YAY!
I have been racking my brain to get that thing to work. I must say “you are the man”. 1st try and it works.

Once again, thanks, I really appreciate it.

David

OK David,
I will have a go, tho’ I am not so good at explaining
first Website-Experiment is your main or _root time line,
next ** content_show** is the mc that sits on that time line, to load a movie into it from another timeline, you need to address it properly - or - with the right path
Another timeline could be ( as in your case) anothe swf or a nested mc. You could also use _parent._parent which does the same thing but is a longer way of going around it.

Hope that is clear ( about as clear as mud I think), you could also try doing a search for paths or pathing or perhaps communicating between swf’s

hope that helps

SteveD

It really does help. Thanks so much. I understand more clearly now. I think I was getting confused because I was working in different movies (or .swf’s) and I was considering the current movie I was working on the _root, since it was the current movie I was working on. But I understand better now. Thanks so much.

And also, one more quick question, and I will quit bothering you, I promise. Would the actionscript be pretty much the same if I was to add a back button to like the preloader1 page, except change the number to 2 instead of 1?

Anyways, thanks so much for the insight.

David

P.S. you can also check it out at www.davidgreer.home.dixie-net.com

Hi
Not sure what you mean by that, if you want to go back to the main movie the code would be:
[AS]
on(release){
unloadMovie(1);
}[/AS]
that would go on a button inside preloader.swf

but if you want the user to go back to the previous loaded movie that gets a bit more complicated

SteveD

yea, that is actually what I meant, for the user to be able to click a button in “preloader1.swf” and be able to go back to the previous movie “archive.swf”. But if it is going to be way complicated, it is no big deal. It works just fine as it is now. You have been way more than helpful, and I don’t ask for you to keep replying to my questions. Thanks for all of the help though. I appreciate it very much.

David

Hi David,
You could make this very easy on yourself by renaming your movies.
I have assumed that your movies are called preloaders.swf, texteffects.swf and so on. If that is so change the names so that they are acalled the same, but put a different number on the end ( 1 - 4), like this
myMovie1.swf, myMovie2.swf and so on
on your button code put this:
[AS]
on(press){
_root.count = 1;
}
on(release){
_root.content_show.loadMovie(“myMovie” + _root.count + “swf”, 1);
//this same code goes on all 4 buttons, just increase _root.count by 1 on each button
}[/AS]

next, on your back button inside the movies put
[AS] on(release){
_root.content_show.loadMovie(“myMovie” + _root.count-1 +“swf”,1)[/AS]

The first lot of code will work, not a hundred percent certain about the syntax on the back button, test it out and let me know, tho’ I am just about done tonight and I am gonna have some dinner.

Cheers

SteveD

Hey

I couldn’t quite get the last script for the buttons going, however, I did finally get a back button to work. I just added the button and give it an actionscript of

[AS]on (release) {
_root.content_show.loadMovie(“archivemovie.swf”, 1);
}
[/AS]

Anyways, thanks for all of the help. I am going to add a Credit section to the site soon, listing different people that contributed to the site. I was wondering if I could mention your name under this section, and maybe a website address if you have one. If you had prefer not, that is fine too. I just wanted to acknowledge the scripting advice that you helped with.

Anyways, thanks again for everything.

Hi,
I wasn’t so sure about that last bit of code, it didn’ t look quite right, I wrote it of the top of my head whilst salivating for my dinner (lol!).
Kind of you to offer links, thank you, but the best thing for you would be to link to kirupa.com thanking contributors to the forum, that way you cover a lot and link to a popular site

Good Luck with your project
SteveD