lqxue

          導航

          <2010年3月>
          28123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          留言簿(5)

          隨筆分類

          文章分類

          收藏夾

          隨筆檔案

          文章檔案

          相冊

          閱讀排行榜

          評論排行榜

          常用鏈接

          統計

          book

          tools

          最新評論

          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 閱讀(270) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 石景山区| 博客| 玉树县| 耒阳市| 海阳市| 辽宁省| 什邡市| 滦平县| 东乌| 宁阳县| 施秉县| 临城县| 无棣县| 琼海市| 遵义县| 五家渠市| 进贤县| 庐江县| 平和县| 南汇区| 武平县| 北海市| 阳江市| 房产| 亚东县| 洛阳市| 清水河县| 渭源县| 东阿县| 荥阳市| 皮山县| 贵州省| 武义县| 新邵县| 富平县| 南京市| 绍兴县| 南漳县| 龙门县| 阿克| 丰原市|