loadMovie in empty movie clip

im currently working on a full flash site and in the main page of this site i use an empty movie clip called contents to call up the next page of the site (these pages are seperate swf files loaded into the clip), inside one of these swf files , i have another empty movie clip to open a subsection of that page into (i have named this one contents2) (e.g. of me doing this is having link on main page to a manufacturers section, loading a page with buttons ranging from a to z, then user selecting the letter and having the relevant page open just under the selection box with the list of mfrs beginning with what letter they are after.)

When i test the 2 swf’s together they link fine, but when i update my site with the pages the links dont work. At first i used the

on (release) {
_root.contents2.loadMovie(“nameofswf.swf”);
}

command but this didnt do anything when posted to my site, so i also gave it a try with the _parent rather than _root as a wild shot, but also didnt work.

Can any body give me some help on this one pls.

Thanks guys & gals! :rambo:

Hi jayb,

If I understand you correctly you have the following.

Main movie = _root
Several loaded movies into EmptyMC = contents
A nested EmptyMC in one of your loaded movies loaded into EmptyMC = contents2

Need to know the name of the loaded swf that contains the EmptyMC = contents2. Lets call it MfgList.

Try this…


on (release) {
_root.MfgList.contents2.loadMovie("nameofswf.swf");
}

Hi andrthad, Thanks for getting back to me.

Yes youv got the idea of how its working (or how it should be!!).

I changed the actions of the button to the below :

on (release) {
_root.manufacturers.contents2.loadMovie(“0-9.swf”);
}

Manufacturers is the name of the swf with the empty movie clip , contents2 the movie clip name and 0-9.swf is the swf file name. Iv published it and tested on my page but still doesnt seem to load the movie.

U dont think it has anything to do with file names or names being too long or anything does it?

:q:

Hi jayb,

Doublecheck to make sure you named the instance name of the EmptyMC in your manufacturers swf. Also could you confirm that this button is located in your manufacturers swf. You could simplify the code and say.


on (release) {
    this.contents2.loadMovie("Zero_Nine.swf");
}

Also it might not like the name “0-9.swf”. Try “Zero_Nine.swf”. I know Flash doesn’t like variables that start with numbers.

If you are loading movies you’ve posted online into another movie, you have to write out the full path of the movie, so instead of:

this.contents2.loadMovie(“0_9.swf”);

write:

this.contents2.loadMovie(“http://www.yoursite.com/../0_9.swf”);

the first works locally as long as the movies are in the same folder, but once online, you need to supply the whole shebang.

(-:

Hi andrthad,

I took your advice and simplified it, renamed the empty movie clip to contents, and also changed the file name to zero_nine.swf , the action behind the button is now :

on (release) {
this.contents.loadMovie(“zero_nine.swf”);
}

and this works fine!!!

Thanku very much for the help.:rambo:

Hey jcs,

I haven’t really experienced that. As long as the swf you want to load is in the same folder, regardless of local machine or web server, it should work like such.


on (release) {
    this.contents2.loadMovie("Zero_Nine.swf");
}

Hi jcs / andrthad,

if the additional swf was in a another folder from the directory your main swf was in rather than put the full address , would it work with just (if the folder was in the same root as the main swf)

on (release) {
this.contents.loadMovie(“foldername/swfname.swf”);
}

is it neccessary to put the whole destination ? (e.g. www.website.etc etc)

hardcoding the path was how I learned it - I suppose the real benefit is just that there’s no room for confusion. If you were to move your main movie, say, to another folder, the browser could still access the loaded movies b/c the whole URL is indicated.

Of course the converse of that is true too! :beam:

Hey guys,

foldername/swfname.swf has always worked for me. Maybe jcs knows of a particular reason why you have to use the full domain path.

Good call. Have a good day:P