help (2 questions)

7 posts

Flag Post

Two things I can’t figure out-
1) I have 2 movieclips. I want to make one be above the other at some point, and below at another. How can I do that?
2) I am planning on making a game. Basically, my character will walk on the floor. The floor will be made of cells, and the character will recieve data from the cell he is standing on and the cell he is facing. Any painless way to do this? The only thing I can think of is giving each cell the name of its coordinate, but thats a LOT of work.

 
Flag Post

1. You can either do movieClip1.swapDepths(movieClip2) or use the depthManager class.

 
Flag Post

2. array of cell objects with all informations?

 
Flag Post

@Undersiege so movieClip1.swapDepths(movieClip2) would change their depths? Nice. Any way to track their depth, also?

@dxOne That would imply typing in the value for each and every cell. I want something simpler. Is there anything of this sort?

 
Flag Post

swapDepths() also accepts a numerical value, ie mc.swapDepths ( 100 );

mc.getDepth() is the corresponding method for retrieving depth info.

 
Flag Post

@dxOne That would imply typing in the value for each and every cell. I want something simpler. Is there anything of this sort?

Arrays will be the best way to go, it’s just a matter of how you get it all stuffed into the array. A fairly easy way to go about it would be to put all of your cells in a movieclip reserved just for them, then run a loop on that movieclip which puts them into the array one by one.

var cells:Array = new Array()
for (var i in mc) {
    cells.push(mc[i]);
}
 
Flag Post

Thats probably a bit complicated for him at this stage, seeing as he’s barely even heard of swapDepths().