PDA

View Full Version : I'm making a huge mess!!!


sandman9
08-01-2003, 08:49 PM
Man I've frustrated myself with my stupidity and unforeseen changes made. Too late to go back now so my question is.

Is it possible to have a main movie and load in another movie into it BUT have this loaded movie give a command such that

on release
using set property, make a MC located in the main movie visiable
and
load a differ movie into "container2" which is also located on the main timeline of the main movie?

Sandman9

sandman9
08-01-2003, 08:55 PM
ahhhh no wonder, I had a _root. in there before set property!?!?!?!

it's been a long day :(

Sandman9

sandman9
08-01-2003, 09:01 PM
still stuck on the loadmovie bit though ..... doesn't seem to be reading it ..... I've never tried this before so can anyone tell me if it's even possible to do?

Thanks
Sandman9

Sualdam
08-01-2003, 09:16 PM
Yes.

If you have for example:_root.gotoAndStop(0);in the loaded movie it will tell the main movie to do that.

However, you MUST make sure that the external movie has fully loaded before allowing or expecting it to do anything because things won't work as planned if the movie hasn't fully loaded.

It is difficult to explain what I'm getting at, but imagine you have a variable set to something in frame 20 of the main movie.

If you load the external movie in a movie clip in frame 5, say, and that loaded movie tries to access the variable set in frame 20, it won't find it because it doesn't exist yet.

sandman9
08-01-2003, 09:27 PM
the user has to click something in the loaded movie so I'm sure that shouldn't be a problem. My script in the movie that's being loaded is:

on (release) {
setProperty("/am", _visible, "1");
loadMovie("wolfe_blowup.swf", "blowup");
}


MC "am" and "blowup" are both on the main timeline of the MAIN movie. The set property works but the loadmovie does not .......

I hope this makes sense
Sandman9

Sualdam
08-01-2003, 09:36 PM
Whereabouts is the button? Main timeline or inside a clip?

Why are you using slash notation - that's very old fashioned.

If I understand your code without looking at the context you used it in, you need this (just guessing):on (release) {
_root.am._visible = true;
loadMovie("wolfe_blowup.swf", "_root.blowup");
}I have assumed that the button is NOT on the main timeline here.

sandman9
08-01-2003, 09:39 PM
The button is on the main timeline of the movie that's being loaded into the main movie. The container is in the main movie though :(. So basically the movie being loaded is trying to load another movie into the main movie ....

That visible code is A LOT better ..... thank you



Hope that wasn't too confusing
Let me know
Sandman9

Sualdam
08-01-2003, 09:43 PM
Well think about it...on (release) {
am._visible = true;
loadMovie("wolfe_blowup.swf", "blowup");
}A button on the main timeline with that code will set the clip 'am' to visible and will load 'wolfe_blowup.swf' into the clip called 'blowup'.

If it doesn't work then either 'am' or 'blowup' isn't present in the frame where you have this button.

sandman9
08-05-2003, 02:13 PM
A button on the main timeline with that code will set the clip 'am' to visible and will load 'wolfe_blowup.swf' into the clip called 'blowup'

This is very true. However this script is not on the main timeline. It is on the main timeline of another movie which is being loaded into a container.

Does this make sense?

The visable command works but not the loadmovie. My loadmovie command is always on the maintime so I've never had a problem with this before. However this time it is not so I'm wondering if there's a way around this?

Thanks
Sandman9

Sualdam
08-05-2003, 02:17 PM
You just need to get your paths right.

Ifon (release) {
am._visible = true;
loadMovie("wolfe_blowup.swf", "blowup");
}works for a button on the main timeline, then if it is ina movie clip you need:on (release) {
_root.am._visible = true;
loadMovie("wolfe_blowup.swf", "_root.blowup");
}Actually, you are best using _parent rather than _root because _root is absolute whereas _parent is relative and can be transported more easily.

When you load a movie into a container you have to think of it as being in a movie clip already when you edit or change it.

sandman9
08-05-2003, 02:23 PM
root did not work but parent did!!! ..... you really seem to know your stuff sualdam

I had always heard the definitions of parent and level's but I guess never really understood it. Now from seeing it in action it has become a lot more clear.

Thanks AGAIN!!!
Sandman9

Sualdam
08-05-2003, 04:10 PM
_root is the main timeline of whatever level you are calling from.

That means that when you have a standalone movie, using _root will access the main timeline of that movie on level 0.

However, if that movie is then loaded into another movie through a loadMovie call the _root now refers to the main timeline of the main movie and not the one it did before. That's usually why movies stop working.

If you use _parent, though, _parent is always the same whether the movie is standalone or loaded into a holder in another one. _parent is the timeline of the movie one nested layer back from where the call is made.

You can add _parents together, so if a movie clip is inside another movie clip, and all of that is loaded into a holder, you can access the main timeline using either _root or _parent._parent.

_root is OK if you know you will not be messing about later - but it will often cause problems if you want the clip to be reusable and not necessarily always in a standalone movie.

sandman9
08-05-2003, 04:26 PM
Yes that's a good explanation. Didn't know you could do a ._parent._parent to target two levels back (interesting!)

This is all straight forward but I don't know why I'm having trouble with my close button now!?!?!?! :(

On my button got:

on (release) {
_root.am._visible = false;
_root.unloadMovie("blowup");
//_root.unloadMovie("wolfe_blowup.swf");
//unlodMovie("blowup");
//unloadMovie("wolfe_blowup.swf");
}

The stuff in comments is other combinations that i've tried and still no luck. blowup is the container wolfe_blowup.swf is being loaded into. I put this button on the main timeline of my main movie. Also on the main timeline of the movie being loaded (with a _parent command once again). Once again the visible command is working but not the UNload command this time!! .... man I don't know why I can't spot the problem again!!!! :(

Sandman9

Sualdam
08-05-2003, 04:40 PM
Try using it like this:_root.clipname.unloadMovie();That definitely works - as long as the paths are correct.

sandman9
08-05-2003, 04:47 PM
Sualdam strikes again!!!!! you are gooooooooooood!

I can't say enough about this place
Thanks again
Sandman9