The Big init() #2

// see previous post for details, this code won't run on it's own
with(addChild(window)){
	x = 10, y = 10;
	with(addChild(c0)) x = 10, y = 10;
	with(addChild(c1)) x = 20, y = 10;
	with(addChild(box)){
		x = 50, y = 10;
		with(addChild(txt)) x = 5, y = 5;
	}
}

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….

Leave a Reply

Your email address will not be published. Required fields are marked *