How do you get a child GameObject static variables?

So I can get the child game object no problem using this code:

			var sCount:int = 0;
			for (var child : GameObject in GameObject.Find("Units")) 
			{ 
				if(child.allunits.selected == true)
				{
					sCount++;
				}
			}
			print(sCount);

But my problem is, my script (allunits) isn’t part of the game object class (obviously), so how do I get the static variable of selected from my children?

What exactly are you trying to get? Because other then the components attached to the GameObjects and considering that there’s no script attached to it the only data that you will be able to get, you be the components data.

The other way is to pass your child object through your script. So like I said above, What are you “variables” are you trying to get?