Load Empty Movie Clip

I’m working on a flash project that has a bunch of different parts. It sort of complicated to explain but i’m going to give it a shot.

I have a main file that has some animation and a few buttons. Each button loads a different swf file into an empty movie clip. These are the different “pages” of my site. I am basing this part off of the tutorial I found here.

Each one of those pages has its own sub navigation, some of which have even more sub navigation. So to give an example:
Main Pages
Home
Projects
About
Click on Projects
(brings up sub navigation as follows)
housing
commercial
religious
Click on Housing
(brings up sub sub navigation as follows)
Project 1
Project 2
Project 3

Now comes the part I dont get.

I would like to use the tutorial found here to show off the photos of the projects. I think what I want to do is create an empty movie clip and load it into the Main Pages area. Then I would like to use that thumbnails tutorial to fill in that empty movie clip to show the photos. This is the part that I get hung up. I can get the empty movie clip but as soon as I click on the project button which is coded like below, all of my flash document goes away and all you see is the swf that is loaded into the movie clip.

Actionscript I use on the button that creates empty movie clip:
ActionScript Code:
[LEFT]p1_bt.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“Project 1 button is working”[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000ff]_root[/COLOR].[COLOR=#0000ff]_root[/COLOR].[COLOR=#0000ff]_root[/COLOR].[COLOR=#0000ff]_root[/COLOR].[COLOR=#0000ff]createEmptyMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“project_mc”[/COLOR], [COLOR=#000080]3[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000ff]_root[/COLOR].[COLOR=#0000ff]_root[/COLOR].[COLOR=#0000ff]_root[/COLOR].[COLOR=#0000ff]_root[/COLOR].[COLOR=#0000ff]_root[/COLOR].[COLOR=#0000ff]loadMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“housing_p1.swf”[/COLOR], [COLOR=#ff0000]“project_mc”[/COLOR][COLOR=#000000])[/COLOR];
container.[COLOR=#0000ff]_x[/COLOR] = [COLOR=#000080]0[/COLOR] ;
container.[COLOR=#0000ff]_y[/COLOR] = [COLOR=#000080]0[/COLOR] ;
[COLOR=#000000]}[/COLOR];
[/LEFT]

I have used AS like the before where I load a swf on top of other swfs using levels but never with an empty movie clip. I dont understand why the project button that I think is supposed to load this housing_p1.swf on top of the other swf replaces the original swf instead.

What am I doing wrong. Is this technique a bad way to go about it, should I be doing this a different way? Please any help would be great!

Josh

would you mind explaining me this :

_root._root._root._root.createEmptyMovieClip(“project_mc”, 3);

what the hell is this?

Adding the other _root. is the only way I can get it to work…I’m not very good with AS but I spend literally days trying to get that part to work, that is the only thing that works (for me). I posted the AS a while ago trying to get some help but nobody could answer me. By this point int he file I am in like 4 clips deep does that matter? I have a clip inside of a clip inside of a clip or something like that. Any sugguestions on how to clean it up would be great, but when I remove the _root._root._root. it doesnt work anymore.

ok.

first of all, there is a way to walk one clip back. its “_parent”, witch calls his closest parent :slight_smile:
wich means, if i’m inside a btn, and want to move 2 movieclips back, we write this._parent._parent

_root means you get back to the root of the site.

ok so cleanup.

p1_bt.onRelease = function() {
trace(“Project 1 button is working”);
//first we delete the previous movie
_root.project_mc.removeMovieClip()
_root.createEmptyMovieClip(“project_mc”, _root.getNextHighestDepth());
_root.project_mc.loadMovie(“housing_p1.swf”);
container._x = 0 ;
container._y = 0 ;
};

Thanks for the help. That cleaned it up and it still works. It also cleaned up some other spots on my site. As far as I can tell it still works. I couldnt get it to work without the mutliple _root. before but it must have been something else that was wrong and I fixed it.

Like I said before, I dont really know that much about Actionscript, but this post was very helpful.

Thanks a lot.
Josh

you’re welcome!

check out the tutorials section, its really good to start studying

you’re welcome!

check out the tutorials section, its really good to start studying