lqxue

          常用鏈接

          統(tǒng)計(jì)

          book

          tools

          最新評(píng)論

          Accecing a field on a tab navigator

          Default Accecing a field on a tab navigator

          hi,


          i have a tab navigator. in one of my functions i'm trying to reference a field which is located on the second tab.

          If i click "ok" from the first tab, which calls the function, which references the field on a second tab, it gives me a runtime error. But if i click on the second tab, and go back to the first, and then click on "OK" it works.

          What is going on? am i supposed to somehow declare taht field before referencing it? to make it active..?

          any help greatly appreciated.

          Thanks!


          this is the error i'm getting:

          TypeError: Error #1009: Cannot access a property or method of a null object reference.
          MadamZuZu is offline   Reply With Quote
            #2

           
           
           
          Default

          The children of a TabNavigator aren't created until they're needed. In your case, only the contents of the first tab are actually created, because they're part of what's needed when the TabNavigator is first displayed. The contents of the second tab won't be instantiated until they need to be displayed, which is when the second tab is clicked on. That's why that error is being thrown until you click on the second tab. This process of only instantiating components as they are needed is called deferred instantiation.

          To force the contents of the other tabs to be instantiated, try changing the creationPolicy property of the TabNavigator to be "all". This will cause all of the different tabs to be instantiated, regardless of having been clicked on.

          In the Flex docs, check out Container.creationPolicy for more details.

          ActionScript Code:
                      
          <mx:TabNavigator creationPolicy="all">

          posted on 2010-03-14 11:34 lqx 閱讀(271) 評(píng)論(0)  編輯  收藏


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 祁东县| 新蔡县| 澄迈县| 扬州市| 蒲江县| 韩城市| 荥经县| 岱山县| 德保县| 三门县| 牡丹江市| 八宿县| 巨鹿县| 海阳市| 台南县| 鄂托克前旗| 西城区| 新乡县| 沙洋县| 鹤壁市| 沛县| 安乡县| 都昌县| 平邑县| 嘉定区| 启东市| 比如县| 嘉荫县| 东乌珠穆沁旗| 玉环县| 易门县| 确山县| 都兰县| 五莲县| 岳阳市| 灌阳县| 吐鲁番市| 柳河县| 通道| 藁城市| 太原市|