Re: Re[2]: [Flashcoders] RE: getDepth: highest depth, middle depth, lowest depth

2006-03-10 Thread Flash Mel
Hey Ivan, thanks!  Just getting around to replying.

On 3/9/06, Iv [EMAIL PROTECTED] wrote:

 Hello Flash,

 FM I am not allowed to use Flash 8 for this project.
 FM They want it published in Flash 6.  From what I was reading the new
 FM DepthManager class only works with Flash 8.

 http://proto.layer51.com/d.aspx?f=834
 use property below main code.


 --
 Ivan Dembicki
 

 [EMAIL PROTECTED] ||
 http://www.design.ru

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] RE: getDepth: highest depth, middle depth, lowest depth

2006-03-09 Thread Flash Mel
Thanks guys!  I was reading the archives about the DepthManager class
and peeked into the recent z ordering thread for some useful info.

My one problem that I am running in to is that for whatever reason, my
boss is telling me I am not allowed to use Flash 8 for this project. 
They want it published in Flash 6.  From what I was reading the new
DepthManager class only works with Flash 8.

I'll post more code snippets when I get in to work.  Thanks again for
the responses!

fm.



On 3/8/06, judah [EMAIL PROTECTED] wrote:
 I've found very little info on the DepthManager class. afaik, you need
 to increment the kTop property when you use it:

 var new_mc = myMovie.createObject(__rowRenderer, new_mc,
 DepthManager.kTop++, {owner:this, styleName:this});

 At the same time I find it useful to get the next highest depth of the
 movieclip I want to be over. This next statement adds the movieclip to
 myMovie at myMovies's next highest depth. So if myMovie has one other
 object on it at depth 1 then myMovie.getNextHighestDepth() returns 2.
 var new_mc = myMovie.createObject(__rowRenderer, new_mc,
 myMovie.getNextHighestDepth(), {owner:this, styleName:this});

 I've had problems using _root.getNextHighestDepth() in a class. It stops
 at a certain number and any new movieclips replace the movie that is at
 the same depth.

 if createObject is not available (for use mostly with components) use
 attachMovie in it's place...

 Judah

 Scott Pobiner wrote:

  Hey Mel,
 
  Take a look at the DepthManager.  You can use it for exactly what you
  are trying to do.  The catch is that you have to instantiate the
  MovieClips  you want to use via actionscript with the DepthManager
  functions.  Remember to do this because the DepthManager needs to
  keep track of all elements you want to sort.  Then all you have to do
  is use the constants DepthManage.kTop, DepthManage.kBottom, etc.  The
  manager sorts its children instances using these constants by putting
  each call to kTop in depth 201 and then moving the rest down
  sequentially (actually vice versa).
 
  Hope this helps,
 
  _S
 
 
  Hello,
 
  I have another question for the group:
 
  I was using this...
 
  for (var i in this) {
  if (typeof (this[i]) == movieclip) {
  trace(movie clip '+this[i]._name+' is at depth
  +this[i].getDepth()*-1);
  }
  }
 
  ...to discover the depth of the movieclips I have on the stage.
 
  Then I wrote this...
 
  postcard_amt = [1, 2, 3];
  for (i=0; ipostcard_amt.length; i++) {
  postcard_itm = postcard+i+_mc;
  _root[postcard_itm].onPress = function(){
  trace(this.getDepth());
  }
  }
 
  ...to specifially single out the _mc's I wanted.
  Not sure if that is the best way to write it, but that's not my
  question
  (althought I am open to more efficient ways).
 
  /*
 
  My question:
  What is the best approach to finding the highest depth, the middle
  depth and
  the lowest depth?
 
  */
 
  Backstory:
  Ideally, what I will be doing is swapDepths() with these _mc's and
  reshuffling them accordingly.
 
  if original state is...
 
  1
  2
  3
 
  ...onEvent...
 
  2
  3
  1
 
  ...then another Event...
 
  3
  1
  2
 
  ...and so on.
 
  Thanks for the advice,
  fm
 
 
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 


 --
 Always bear in mind that your own resolution to succeed is more important 
 than any one thing.

 You can have anything you want - if you want it badly enough. You can be 
 anything you want to be, do anything you set out to accomplish if you hold to 
 that desire with singleness of purpose.

 - Abraham Lincoln

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re[2]: [Flashcoders] RE: getDepth: highest depth, middle depth, lowest depth

2006-03-09 Thread Iv
Hello Flash,

FM I am not allowed to use Flash 8 for this project.
FM They want it published in Flash 6.  From what I was reading the new
FM DepthManager class only works with Flash 8.

http://proto.layer51.com/d.aspx?f=834
use property below main code.


-- 
Ivan Dembicki

[EMAIL PROTECTED] || 
http://www.design.ru

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re[2]: [Flashcoders] RE: getDepth: highest depth, middle depth, lowest depth

2006-03-09 Thread Iv
Hello,

example of pyramidal depth management:

MovieClip.prototype.addProperty(topDepth, function () {
   var mc, mcd, d;
   for (mcd in this) {
  if ((mc=this[mcd])._name == mcd  mc instanceof MovieClip  mc._parent == 
this) {
 return (d=this[mcd].getDepth()+1)1 ? 1 : d;
  }
   }
   return 1;
}, null);

// ---
this.onReleaseHandler = function() {
this.pyramiDepth(false);
};
this.pyramiDepth = function(depth, direction) {
if (depth === false) {
depth = this._parent.topDepth-1;
this.swapDepths(depth);
this.next_mc.pyramiDepth(depth-2, 1);
this.prev_mc.pyramiDepth(depth-3, -1);
} else {
this.swapDepths(depth);
if (direction == 1) {
this.next_mc.pyramiDepth(depth-2, 1);
} else if (direction == -1) {
this.prev_mc.pyramiDepth(depth-2, -1);
}
}
};
this.createAnyMc = function(this_obj, name, depth, prev_mc) {
var mc = this_obj.createEmptyMovieClip(name, depth);
mc.prev_mc = prev_mc;
prev_mc.next_mc = mc;
mc._x = (prev_mc._x+30) || 20;
mc.lineStyle(0, 0xFF, 100);
mc.beginFill(0xCC, 100);
mc.lineTo(40, 0);
mc.lineTo(45, 20);
mc.lineTo(40, 40);
mc.lineTo(0, 40);
mc.lineTo(-5, 20);
mc.lineTo(0, 0);
mc.endFill();
mc.onRelease = this.onReleaseHandler;
mc.pyramiDepth = this.pyramiDepth;
trace(mc.prev_mc);
return mc;
};
//
var prev_mc = undefined;
for (var i = 0; i6; i++) {
prev_mc = this.createAnyMc(this, mc+i, i, prev_mc);
}



-- 
Ivan Dembicki

[EMAIL PROTECTED] || 
http://www.design.ru

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] RE: getDepth: highest depth, middle depth, lowest depth

2006-03-08 Thread Scott Pobiner

Hey Mel,

Take a look at the DepthManager.  You can use it for exactly what you  
are trying to do.  The catch is that you have to instantiate the  
MovieClips  you want to use via actionscript with the DepthManager  
functions.  Remember to do this because the DepthManager needs to  
keep track of all elements you want to sort.  Then all you have to do  
is use the constants DepthManage.kTop, DepthManage.kBottom, etc.  The  
manager sorts its children instances using these constants by putting  
each call to kTop in depth 201 and then moving the rest down  
sequentially (actually vice versa).


Hope this helps,

_S



Hello,

I have another question for the group:

I was using this...

for (var i in this) {
if (typeof (this[i]) == movieclip) {
trace(movie clip '+this[i]._name+' is at depth
+this[i].getDepth()*-1);
}
}

...to discover the depth of the movieclips I have on the stage.

Then I wrote this...

postcard_amt = [1, 2, 3];
for (i=0; ipostcard_amt.length; i++) {
postcard_itm = postcard+i+_mc;
_root[postcard_itm].onPress = function(){
trace(this.getDepth());
}
}

...to specifially single out the _mc's I wanted.
Not sure if that is the best way to write it, but that's not my  
question

(althought I am open to more efficient ways).

/*

My question:
What is the best approach to finding the highest depth, the middle  
depth and

the lowest depth?

*/

Backstory:
Ideally, what I will be doing is swapDepths() with these _mc's and
reshuffling them accordingly.

if original state is...

1
2
3

...onEvent...

2
3
1

...then another Event...

3
1
2

...and so on.

Thanks for the advice,
fm




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] RE: getDepth: highest depth, middle depth, lowest depth

2006-03-08 Thread judah
I've found very little info on the DepthManager class. afaik, you need 
to increment the kTop property when you use it:


var new_mc = myMovie.createObject(__rowRenderer, new_mc, 
DepthManager.kTop++, {owner:this, styleName:this});


At the same time I find it useful to get the next highest depth of the 
movieclip I want to be over. This next statement adds the movieclip to 
myMovie at myMovies's next highest depth. So if myMovie has one other 
object on it at depth 1 then myMovie.getNextHighestDepth() returns 2.
var new_mc = myMovie.createObject(__rowRenderer, new_mc, 
myMovie.getNextHighestDepth(), {owner:this, styleName:this});


I've had problems using _root.getNextHighestDepth() in a class. It stops 
at a certain number and any new movieclips replace the movie that is at 
the same depth.


if createObject is not available (for use mostly with components) use 
attachMovie in it's place...


Judah

Scott Pobiner wrote:


Hey Mel,

Take a look at the DepthManager.  You can use it for exactly what you  
are trying to do.  The catch is that you have to instantiate the  
MovieClips  you want to use via actionscript with the DepthManager  
functions.  Remember to do this because the DepthManager needs to  
keep track of all elements you want to sort.  Then all you have to do  
is use the constants DepthManage.kTop, DepthManage.kBottom, etc.  The  
manager sorts its children instances using these constants by putting  
each call to kTop in depth 201 and then moving the rest down  
sequentially (actually vice versa).


Hope this helps,

_S



Hello,

I have another question for the group:

I was using this...

for (var i in this) {
if (typeof (this[i]) == movieclip) {
trace(movie clip '+this[i]._name+' is at depth
+this[i].getDepth()*-1);
}
}

...to discover the depth of the movieclips I have on the stage.

Then I wrote this...

postcard_amt = [1, 2, 3];
for (i=0; ipostcard_amt.length; i++) {
postcard_itm = postcard+i+_mc;
_root[postcard_itm].onPress = function(){
trace(this.getDepth());
}
}

...to specifially single out the _mc's I wanted.
Not sure if that is the best way to write it, but that's not my  
question

(althought I am open to more efficient ways).

/*

My question:
What is the best approach to finding the highest depth, the middle  
depth and

the lowest depth?

*/

Backstory:
Ideally, what I will be doing is swapDepths() with these _mc's and
reshuffling them accordingly.

if original state is...

1
2
3

...onEvent...

2
3
1

...then another Event...

3
1
2

...and so on.

Thanks for the advice,
fm





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
Always bear in mind that your own resolution to succeed is more important than any 
one thing.

You can have anything you want - if you want it badly enough. You can be anything you want to be, do anything you set out to accomplish if you hold to that desire with singleness of purpose. 


- Abraham Lincoln

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com