Better understanding a action

Hello, here is my question.

I did the tutorial for “create a full flash site” under flash mx advance. I did everything right and it worked. Ok here is what i want to somebody to help me out.

The action: on (release) {
_root.contents.loadMovie(“locations.swf”);
}

because when i extracted the zip file it had only the different swf. files and the main file where they were going to be loaded.

What i am saying is do all the swf. files have to have some connection to the main movie where i am loading the swf. files in order for it to work or it doesn’t matter. so what am trying to say is i could have any swf. file and use that action to my main movie even if has nothing in come and it will play it.

and my other question is where can i find the mean for root and contents.

sorry for the confusion :.)

I think you might have some typos in that post there, but I’ll do my best.

Okay, first, any .swf should be able to be loaded as long as it bears the same name, i.e. “locations.swf” and is in the same directory (folder) and as long as the original movie doesn’t reference variables, framelabels, etc. in the loaded movie.

Second of all, here’s the basic meaning of _root

Flash has a “tree-like structure,” so that the main part of your movie (the main timeline and everything on it) is like the “roots” of a tree. If you have a movie clip called “contents” on your main timeline, you can reference it in AS by using “_root.contents”

If there is another movie clip inside the movie clip “contents,” let’s call it “secondmovieclip,” you can reference it by “_root.contents.secondmovieclip”

similarly, there is also the statements “this” and “_parent”

“this” is used to manipulate the current object (on which you have written the code). For example, if you want to change the x coordinate position of a movie clip as it plays, you can use

onClipEvent(enterFrame){
this._x +=20;
}

this moves the movie clip 20 pixels to the right for every passing of a flash frame.

“_parent” is used to reference the movie clip that contains the movie clip/button etc. on which the code is written. In the example above, if you were writing code on the movie clip “second movie clip,” if you wrote “_parent.secondmovieclip”
then the subsequent code would affect the “contents” movie clip.

Make sense?

There’s tutorials on this site if you look for them.

THE SEARCH BUTTON IS YOUR FRIEND!!!

–EP

hey, thanks alot for the reasponse. I really do appreicate it.