-
[RESOLVED] [HELP] Make sure it is up?
Hello guys, how do I check if an object is on top of another?
-
Lifetime Friend of Site Staff
Use movieclip.getDepth() to get the depth and compare it to the depth of any other clip on the stage.
See https://www.kirupa.com/developer/act...pt/depths2.htm for more information.
When your swf2exe tool just HAS to work
there's only one choice... SWF Studio
-
Client Software Programmer
sometimes getdepth wont work without this at the top:
import mx.managers.DepthManager;
-
Hmm.. I will chek it, thank you guys.
-
Sorry for the spam, but, I dont understand how to compare the Depth of two objects. What I try is simple, check if the player is up of a ball, if this is true, enable a var and the function to enter in the tank when click the space key.
-
.
Hi,
You can try to get what you need from this.
PHP Code:
trace("Orignal Depths\nball: " + ball.getDepth() + " \nplayer: " + player.getDepth());
function newDepths():Void { ball.swapDepths(this.getNextHighestDepth()); player.swapDepths(this.getNextHighestDepth());
var a:Number = ball.getDepth(); var b:Number = player.getDepth();
trace("\n\nNew Depths\nball: " + a + " \nplayer: " + b);
if (b > a) { trace("\nYou can now set your var"); } }
newDepths();
-
Hello guy, I test this code but dont work correctly. I want this:
img_01.png
img_02.png
Understand?
-
[SOLVED] [HELP] Check if we are standing?
Man, I was working with the wrong code. The correct is use the hitTest function. Thanks anyway!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|