Normally you listen for a CHANGE event and check the selectedIndex

On 3/17/10 9:26 AM, "Nini7016 Nini7016" <nahloulaha...@hotmail.com> wrote:






Hello


I would like to know which child of tabNavigator is clicked :

There is my code :

public function TabOnglet()
        {
            super();
            this.setStyle("borderStyle" , "solid");
            //this.percentHeight = 100;
            this.percentWidth = 100;
            this.createTab(this);
            //create an listen to the event
            this.initEventListener();

        }
        /**
         *
         * @param tabNavigator
         *
         */
        private function createTab(tabNavigator : TabNavigator) : void
        {
            var canvas1: Canvas= new Canvas();
            canvas1.percentHeight=100;
            canvas1.percentHeight = 100;
            canvas1.percentWidth = 100;
            canvas1.label = "BPMN";

            var canvas2: Canvas= new Canvas();
            canvas2.percentHeight=100;
            canvas2.percentHeight = 100;
            canvas2.percentWidth = 100;
            canvas2.label = "BPEL";
            canvas2.id="bpel";

            tabNavigator.addChild(canvas2);
            tabNavigator.addChild(canvas1);
        }
        /**
         * initialise the event
         *
         */
        private function initEventListener() : void
        {

            trace(this + " cré un écouteur");

            trace(this.getTabAt(1) + 
"------------------------this.getTabAt(1)______________r");
            //this.addEventListener(MouseEvent.CLICK, interceptClick, true);
            var tab:Button = this.getTabAt(1);
            tab.addEventListener(MouseEvent.CLICK,interceptClick);
            //this.getChildAt(1).addEventListener(MouseEvent.CLICK, 
interceptClick, true);

        }

in the browser it displays this message : 'Il est impossible d'accéder à la 
propriété ou à la méthode d'une référence d'objet nul" that is mean it is 
impossible to acceed to a propriety or method of a reference of object  which 
is nul .


Thanks

Any idea please ???



________________________________
Acheter en ligne en toute sécurité ? Internet Explorer 8 vous protège 
gratuitement ! <http://clk.atdmt.com/FRM/go/206608211/direct/01/>





--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to