How to get the depth of a MovieClip the highest?
3 posts
Page 1 of 1
Ok first this is with my game I am working on. Here is a picture of the problem.
note: i have two layers one is actions (middle) and movieClip(on bottom) and text (on top) there is nothing on the layers there blank except on layer text were i put on score the rest is loaded from the library.
now that is what cover up my score with every other movie clip, the rocket, bullets, and fire they all are similarly loaded to the Stage.
the code
My idea to fix it is to load them to separate layers, but i dont know how?
the movie clip just loads itself to _root so its in every scene for a example in the game over screen the enemys are still there?
Here is the game if needed to see it viewtopic.php?f=54&t=5483
Ok i think there should be enough info to try to help. It could be a simple fix. :? :?
+rep if it you solve my problem
Now time to show the code i am using for the falling objectsnote: i have two layers one is actions (middle) and movieClip(on bottom) and text (on top) there is nothing on the layers there blank except on layer text were i put on score the rest is loaded from the library.
Code: Select all
this the function i use in my onEnterFrame so...function enemy():Void {
enemyTime++;
if (enemyTime == enemyLimit) {
enemyID++;
_root.attachMovie('mcEnemy', 'enemy'+enemyID, _root.getNextHighestDepth());
_root['enemy'+enemyID]._x = int(Math.random()*Stage.width);
_root['enemy'+enemyID]._y = -50;
_root['enemy'+enemyID].onEnterFrame = function() {
this._y += enemyspeed;
if (this._y>=Stage.height) {
this.removeMovieClip();
}
if (this.hitTest(_root['Bullet'+bulletID])) {
this.removeMovieClip();
_root['Bullet'+bulletID].removeMovieClip();
score += scorePlus;
}
if (this.hitTest(_root.mc)) {
this.removeMovieClip();
score -= scoreMinus;
}
};
enemyTime = 0;
//reset the time
}
}
now that is what cover up my score with every other movie clip, the rocket, bullets, and fire they all are similarly loaded to the Stage.
the code
Code: Select all
is my problem _root.attachMovie('mcEnemy', 'enemy'+enemyID, _root.getNextHighestDepth());
My idea to fix it is to load them to separate layers, but i dont know how?
the movie clip just loads itself to _root so its in every scene for a example in the game over screen the enemys are still there?
Here is the game if needed to see it viewtopic.php?f=54&t=5483
Ok i think there should be enough info to try to help. It could be a simple fix. :? :?
+rep if it you solve my problem
You do not have the required permissions to view the files attached to this post.
Last edited by Twiffler on Tue Apr 05, 2011 4:41 pm, edited 1 time in total.
I personally have no experience for this, but i was kind and did a small search on Google, and got this as two of the results:
http://www.tomauger.com/?p=11
http://board.flashkit.com/board/showthread.php?t=799628
http://www.tomauger.com/?p=11
http://board.flashkit.com/board/showthread.php?t=799628
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
Codex thanks the first link had some code that helped, but every thing shows up on my game over screen
so if any one know how to stop that thanks
so if any one know how to stop that thanks
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023