Hi All,
I am adding two textfields dynamically using the code written below and
after that i am trying to set the tabindex for the two textfields. But i am
not able to set the tabIndex for the textfields added dynamically. Can
anyone please guide what am i doing wrong here? Here is the code for the
same
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.managers.FocusManager;
import mx.core.UIComponent;
import mx.core.UITextField;
function fnDrawTextField(){
var mytxt:TextField = new TextField ();
var ut:UIComponent = new UIComponent()
mytxt.width = 300
mytxt.height = 40
mytxt.text = "Called the function";
mytxt.x = 100;
mytxt.y = 100;
mytxt.type = TextFieldType.INPUT
mytxt.border = true
mytxt.tabEnabled =true;
mytxt.tabIndex =1;
ut.addChild(mytxt)
this.addChild(ut)
}
function fnDrawTextFieldSecond(){
var mytxt:TextField = new TextField()
var ut:UIComponent = new UIComponent()
mytxt.width = 300
mytxt.height = 40
mytxt.text = "Called the function";
mytxt.x = 500;
mytxt.y = 500;
mytxt.type = TextFieldType.INPUT
mytxt.border = true
mytxt.tabEnabled = true
mytxt.tabIndex =2;
ut.addChild(mytxt)
this.addChild(ut)
}
]]>
</mx:Script>
<mx:Button x="333" y="309" click="fnDrawTextField();">
</mx:Button>
<mx:Button x="578" y="309" click="fnDrawTextFieldSecond();">
</mx:Button>
</mx:Application>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders