Skip navigation
Zac.T
Currently Being Moderated

Depth in Drag and Drop

Aug 1, 2008 8:06 AM

Hi!

I was wondering if there are any ways to put an object in front or behind another based on its position in relation to the other one, to create the illusion that there is depth. This would be used in a file to create a 'room', where the x and y positions of the objects would be saved in a database. That bit I can do. I just need to know how to create the illusion of depth within the 'room'.

I'd like this in isometric view, please.

Thanks in advance.
~Zac
 
Replies
  • kglad
    62,208 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 1, 2008 8:17 AM   in reply to Zac.T
    use the getDepth() and swapDepths() property of movieclips.
     
    |
    Mark as:
  • kglad
    62,208 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 1, 2008 9:21 AM   in reply to Zac.T
    i can't answer that specifically because i don't know the rationale you should use to set depths.

    but, in general, you can store all the depths in an array (using getDepth() and iterating all your display objects), sort() that array and create another array of your objects.

    then use a custom sort on your object array using the criteria that suits your project and finally iterate through your object array assigning depths (using swapDepths() ) from the sorted depth array.
     
    |
    Mark as:
  • kglad
    62,208 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 1, 2008 10:00 AM   in reply to Zac.T
    you're welcome.
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points