3 Replies Latest reply on Oct 19, 2006 11:09 PM by 01robert

    How to initialize controls' eventHandler in a TabNavigator?

    01robert Level 1
      Like following script, the btnA is null when iniMe is invoked.

      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns:ns1="ctls.*" initialize="iniMe();">
      import mx.controls.Alert;
      function iniMe(){
      if (btnA==null) mx.controls.Alert.show("btnA is null!");
      function myFunc(event:Event):void{
      <mx:TabNavigator x="64" y="71" width="200" height="200" >
      <mx:Canvas id="canvasA" label="tabA" width="100%" height="100%">
      <mx:Button id="btnA" x="42" y="77" label="ButtonA"/>


      How do i add eventHandler to btnA using ActionScript? ( Not in mxml)