<!-- Coding Horrors -->
Home   Submit Random All Snippets Lessons/Resources

"Actionscript 3 Depthsorting Horror"

Language: Actionscript 3

Written in 2008

Submitted by Louis, 08.06.2008 15.10.00

(((_worldLayer.getChildAt(0) as Sprite).getChildAt(internal((((_TEST_objectsArray[0] as TileObject).Art.Artwork as Sprite).y + 1000) / TileRules.TILE_DIMENSIONS)) as Sprite).getChildAt(0) as ZSlice).ObjectSprite.addChild((_TEST_objectsArray[0] as TileObject).Art.Artwork as Sprite);
Submitter's comments:

What's Wrong

there is just so much going on on this one line. The reason was a lack of focus on a particular object (such as a member var) so I had to derive what I wanted every time.

Suggested Fix

It was eventually fixed with member variables, but a temp solution was breaking down the line with local vars so it would make more sense, when reading it.

Add a Comment
Name
Comment