The Big init() #2

Actionscript:
  1. // see previous post for details, this code won't run on it's own
  2. with(addChild(window)){
  3.     x = 10, y = 10;
  4.     with(addChild(c0)) x = 10, y = 10;
  5.     with(addChild(c1)) x = 20, y = 10;
  6.     with(addChild(box)){
  7.         x = 50, y = 10;
  8.         with(addChild(txt)) x = 5, y = 5;
  9.     }
  10. }

It's entertaining to try and think of different DisplayObject nesting techniques. I have a few more of these rolling around in my head that I'll try out soon.... The only good/notable thing about the above is that it shows that nested with statements actually work like you'd expect them to....

This entry was posted in misc and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*