Flexcomps’s Weblog

Finding and changing BG color of all input TextField Instances

Posted by: Yogesh Puri on: September 8, 2008

Following is the code for finding and changing BackGround color of all the Input textfields in a perticular scope

//---- Import classes ----------
import flash.utils.getQualifiedClassName;
import flash.text.TextField;
import flash.text.TextFieldType;
//--------- initialize variables ----
var temp:Array;
trace(this.numChildren)
for(var k:int=0;k < this.numChildren;k++){
var child:* = this.getChildAt(k);
if(getQualifiedClassName(child) == "flash.text::TextField"){
var childIns:TextField = child as TextField;
if(childIns.type == TextFieldType.INPUT){
changeBGColor(childIns);
}
}
}

//---- function to change BG color of input boxes ------
function changeBGColor(textFieldObj:TextField){
textFieldObj.background = true;
textFieldObj.backgroundColor = 0x00ffff;
}

Leave a Reply

 

September 2008
M T W T F S S
« Aug   Oct »
1234567
891011121314
15161718192021
22232425262728
2930  

Blog Stats

  • 94,229 hits