movie clip depth setting

  • dirksmith
  • Student
  • Student
  • dirksmith
  • Posts: 78

Post 3+ Months Ago

Hi

I've set a series of movie clips buttons to automatically assume the highest position on on mouse press - however, I'd like the movie clips to remain under (a lower depth) a movie clip (a 'picture frame') on another higher layer.

The depth change for the movie clip buttons was achieved using:


on (press) {
//Start Dragging Movieclip Behavior
startDrag(this, false, 168, 224, 564, 476);
this.swapDepths(this._parent.getNextHighestDepth());

//End Behavior


Any ideas on assigning a higher depth to the 'picture frame' on the highest layer - so effectively the movie clip buttons remian underneath it.

I tried masking but not working.

Thanx

Dirk
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • chrisjones
  • Born
  • Born
  • chrisjones
  • Posts: 1

Post 3+ Months Ago

Hi,

Put all this code in a frame on the root timeline, changing the names as necessary (ie "btn1"):
Code: [ Select ]
btn1.onPress = function() {
   this.startDrag();
   setDepths(this);
}
btn1.onRelease = function() {
    this.stopDrag();
}
btn2.onPress = function() {
    this.startDrag();
    setDepths(this);
}
btn2.onRelease = function() {
    this.stopDrag();
}


function setDepths(movie) {
    _root.btn1.swapDepths(1);
    _root.btn2.swapDepths(2);
    movie.swapDepths(3);
}
  1. btn1.onPress = function() {
  2.    this.startDrag();
  3.    setDepths(this);
  4. }
  5. btn1.onRelease = function() {
  6.     this.stopDrag();
  7. }
  8. btn2.onPress = function() {
  9.     this.startDrag();
  10.     setDepths(this);
  11. }
  12. btn2.onRelease = function() {
  13.     this.stopDrag();
  14. }
  15. function setDepths(movie) {
  16.     _root.btn1.swapDepths(1);
  17.     _root.btn2.swapDepths(2);
  18.     movie.swapDepths(3);
  19. }
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

see this and tell me if you understand something. In your case could be more simple. After you swap your button, swap also the movieclip with the image.
Code: [ Select ]
on (press) {
//Start Dragging Movieclip Behavior
startDrag(this, false, 168, 224, 564, 476);
this.swapDepths(this._parent.getNextHighestDepth());
this._parent.myImage.swapDepths(this._parent.getNextHighestDepth());
}
  1. on (press) {
  2. //Start Dragging Movieclip Behavior
  3. startDrag(this, false, 168, 224, 564, 476);
  4. this.swapDepths(this._parent.getNextHighestDepth());
  5. this._parent.myImage.swapDepths(this._parent.getNextHighestDepth());
  6. }
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

I would place all the movieclips that swap depths in a container clip, that is at a lower depth than the true top-level movieclip, aka the "picture frame".

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 10 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.