PDA

View Full Version : Depth and Disappearing Clips


Ferret
06-27-2007, 08:00 PM
I've got a huge problem. I'm making a board game and the board is too big for one frame. So I broke it up into 5 different frames. I tested the first two to do this: When one guy has moved from the first frame to second, it needs to go back to the next guy who needs to move in frame 1. So when it switches back to frame 1, it has to remove the movie clip of the guy in the second frame and re-attach the guy in the first frame to the stage (I'm using attachMovie() by the way for all the characters). So I did this:


if (players[turnorder[turn].fert].ferret == "doodles") {
burt = "HOOPDEEDOOP";
//that burt thing is just a debug check, ignore it.
attachMovie("Ferrets_Doodles", "doodles", 30);
if (eval(sqh) != 5) {
doodles._x = board[eval(sqh)].x;
doodles._y = board[eval(sqh)].y;
} else {
doodles._x = 280;
doodles._y = 51;
}
}


The game is complicated, but here's what's happening.
I made a dynamic box and burt did indeed change to "hoopdeedoop", so it's reading the code. The rest works fine. But I have 3 other characters around him, and I put 5 depth difference between them (like freddy is 35, doodles is 30, bonnie is 40, and lily is 45). But doodles and lily sometimes never appear, it never attaches their movie clips. I have the exact same code for all four ferrets. And it's only sometimes. I'm guessing they're disappearing because they don't have enough depth between them. Or maybe it's because i have this code to attach it THEN I go to frame 1. Can anyone help me? :confused:
Thx in advance!

majicassassin
06-28-2007, 08:10 AM
I can't actually tell what you're trying to do with the code... but my guess is that your attachMovie or however you're adding the others is overwriting the previous one, so you only see one at a time.

Ferret
06-29-2007, 02:14 AM
No, that's not it... Because I have more script telling the movie clip to move, but it won't, and besides, they don't stack on top of eachother. Let me rephrase my question without all the confusion:

How much depth must be inbetween movie clips for them to not disappear, and do movie clips disappear if you attach them to stage then change to a different frame on the main timeline?

majicassassin
06-29-2007, 03:47 AM
The answer to your first question is 1. I have a small application I made that uses the depths of 1 to 100 for 100 different objects, and all of them show up.
As to the second question, I think the stage does lose everything when you move to a different frame. This is why its generally a good idea not to use the main timeline for anything other than complete scene changes.

As for your game, it might be better to wrap the entire movie inside a movie clip and move that around. So it would be like mc_gameboard contains everything, then whenever you want to center the camara you hae a timer or something that'll keep doing mc_gameboard.x += 1; First off, this'll keep things simpler, and second off you can have a nifty looking panning effect on the board. (and if you really want to have fun, try to make it go fast and motion blur it ;).).

Hope that helped some?

Ferret
06-29-2007, 03:54 PM
yes, thx it works now. I put the gotoAndStop() before all the code. And yes, I think I'll try your idea with the board in one movie clip. Thx a lot!:D

majicassassin
06-29-2007, 10:01 PM
Aite, cool. Good luck =^^=