A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [F8] depth problem: getting behind the wall...

  1. #1
    Humble Flash Newbie
    Join Date
    Feb 2007
    Posts
    107

    [F8] depth problem: getting behind the wall...

    My baddies is on a depth of about 100. I had a "wall" placed on the stage, which then gets a depth of -16000 something. Now, I want the "wall" to have one part at the very bottom and one at the top, covering the baddies.

    So, I created a "wall" mc, containing the mc's wall_top and wall_bottom (to allow hittesting with only one mc). All placed instance names are the same, but beginning with "the". Next, I tried to put wall_top above my baddies but below my cursor (depth 1000) with:
    Code:
    	thewall.thewall_top.swapDepths(900);
    Checking the depth with getDepth() confirms that it worked. However, all baddies are still above "wall"! Probably, because the parent mc "thewall" has a low depth that seems to override the depths of the child walls...

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    If baddies and thewall are on same timeline, then all the children of thewall will be behind the baddies too. You want to take thewall_top out of the thewall and place it same timeline with baddies.

  3. #3
    Humble Flash Newbie
    Join Date
    Feb 2007
    Posts
    107
    So, does that mean that it's impossible to have an mc x that contains 2 mc's that are on different sides (depthwise) of another mc on the same timeline as x?

    The pointer/"hero" can't pass the walls, while the baddies pass over or behind them. Will I have to make two hittests for the pointer and the walls then?

  4. #4
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Quote Originally Posted by Clownfish5
    So, does that mean that it's impossible to have an mc x that contains 2 mc's that are on different sides (depthwise) of another mc on the same timeline as x?
    Yep, only children of same parent can change depths. Lets say mc A has children A1 and A2, mc B has B1 and B2. If A has higher depth then B, it means both A1 and A2 are always above B1 and B2. You can change depths of A1 and A2 to make one of them appear above other, you can do same with B1 and B2, but you cant place B1 above A1 without changing depths of A or B, or removing B1 from B and placing it on A and B timeline.

  5. #5
    Humble Flash Newbie
    Join Date
    Feb 2007
    Posts
    107
    Ok, thanx for explaining! I guess I'll just make a custom hittest function that takes care of both separate walls then!

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