Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Changing movie clips depth

LEGEND ,
Oct 11, 2006 Oct 11, 2006
Hi,

I'm building a rotating menu and need to change the depth of the button
movie clips at the time they pass the top to creat a 3D effect. how can I
change the depth of a specific movie clip using action scripting?




TOPICS
ActionScript
532
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 11, 2006 Oct 11, 2006
MovieClip.prototype.changeDepth = function() {
var highestDepth = 0;
for (var i in this._parent) {
highestDepth = (eval(i).getDepth()>highestDepth) ? eval(i).getDepth() : highestDepth;
}
this.swapDepths(highestDepth);
};
myMovieClip = "menu"// this being the name of your menue system
for (var i in myMovieClip) {
if (typeof (eval(i)) == "movieclip") {
eval(i).onRollOver = function() {
this.changeDepth();
};
}
}
// what this will do is loop through ever movieClip within your menu and apply the "onRollOver" function to each movieClip within.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 11, 2006 Oct 11, 2006
even on rollOver
this.swapDepth(this._parent.getNextHighestDepth())
🙂
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 11, 2006 Oct 11, 2006
ah "getNextHighestDepth()" function, theres a bug in using this in Flash Pro 8 Im afraid. Thats why Ive suggested using the above.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 11, 2006 Oct 11, 2006
hey whats that bug, i m not aware, kindly share the info if u know
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 14, 2006 Oct 14, 2006
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 11, 2006 Oct 11, 2006
Okay, correct me if I'm wrong. In this way the depth keeps increasing and
will finally reach the limit (if there's any) causing erratic behaviour in
the movie clip. I just need to swap two depths of two different movie clips.
I need to create a kind of card shuffle like motion.



"DazFaz" <webforumsuser@macromedia.com> schreef in bericht
news:egikak$s0a$1@forums.macromedia.com...
> MovieClip.prototype.changeDepth = function() {
> var highestDepth = 0;
> for (var i in this._parent) {
> highestDepth = (eval(i).getDepth()>highestDepth) ? eval(i).getDepth() :
> highestDepth;
> }
> this.swapDepths(highestDepth);
> };
> myMovieClip = "menu"// this being the name of your menue system
> for (var i in myMovieClip) {
> if (typeof (eval(i)) == "movieclip") {
> eval(i).onRollOver = function() {
> this.changeDepth();
> };
> }
> }
> // what this will do is loop through ever movieClip within your menu and
> apply
> the "onRollOver" function to each movieClip within.
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 11, 2006 Oct 11, 2006
Heres a good example of understanding depths:

http://www.kirupa.com/developer/isometric/depth_sorting.htm
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines