dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: depth control

  1. #1
    Member
    Join Date
    Apr 2007
    Location
    U.S.
    Posts
    86

    depth control

    Is there some some way to change the depth of a MC without using SwapDepth? Like a z coordenate or something?

  2. #2
    Senior Member RangrJay's Avatar
    Join Date
    Sep 2005
    Location
    Las Vegas
    Posts
    163
    I've seen some stuff based one what you want, but it was used in 3D physics, which is pretty high up on the guru scale. And from what i've seen, it was used in rotations and what not that didn't have a direct effect on anything. Just calculating angles for vectors.

    The depths assigned are nothing more then just layers, not coord based on an origin (at least for depth). For a z-coord you'd have to use a 3D dev environment.
    Xero Patience Studios
    Web Design
    Software Development
    Graphic/Logo Design

  3. #3
    Member
    Join Date
    Apr 2007
    Location
    U.S.
    Posts
    86
    I don't think you understood me. I have some amount of movie clips. I want to have one randomly chosen one appear in front of the others. Any idea on how I can do that?

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    myMC.swapDepths(this.getNextHighestDepth());
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  5. #5
    Member
    Join Date
    Apr 2007
    Location
    U.S.
    Posts
    86
    myMC.swapDepths(this.getNextHighestDepth());
    Will this move the MC to the top or switch it's position with the one on top (I need the first of the 2)?

  6. #6
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    it will do the first one ... remember when in doubt ... experiment yourself
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  7. #7
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    alternatively set your mc depths
    mc1.swapDepths(1);
    mc2.swapDepths(2);
    mc3.swapDepths(3);

    and then for instance

    mc1.onRelease = function() {
    this.swapDepths(5);
    }
    mc2.onRelease = function() {
    this.swapDepths(5);
    }
    mc3.onRelease = function() {
    this.swapDepths(5);
    }

    everytime you click the mc it's depth will be set to 5 and it will swap its depth with the mc that was already set to 5.

  8. #8
    Member
    Join Date
    Apr 2007
    Location
    U.S.
    Posts
    86
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center