i have an object that when entering the movie, needs to be "aware" of text boxes around it. Am i going about this the wrong way?

Code:
//detect input boxes, if any
//start with the document class's objects
			var main:Sprite=Sprite(stage.getChildAt(0));
			var objs=main.numChildren;
			for(var g=0;g<objs;g++)
			{
				var echob=main.getChildAt(g)
				if(echob=='[object TextField]')
				{
					trace(echob);
				}
			}
i feel like i am breaking away from the OOP style, but i can't think of another way to make this happen. Any thoughts out there?

Bonus question...is there a cleaner way to write this part 'if(echob=='[object TextField]')'???