Thanks very much for making that but it throws the same exception when
I click on any tabs. I used your code verbatim, here's my mxml file
that loads it:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
creationComplete="initApplication()">
      <mx:Script>
            <![CDATA[
                  import NestedTabs.NestedTabs;           
                 
                  public function initApplication():void      {
                        var ntn:NestedTabs = new NestedTabs();
                        this.addChild(ntn);
                  }
            ]]>
      </mx:Script>
</mx:Application>

Does the error happen to you when you try it?




--- In [email protected], "oca_gw" <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi rigidcode,
>
> Here is an ActionScript class that you can use. It will need to be
> changed to meet your needs, but it is based off the code you posted,
> and should be reasonably self-explainatory.
>
> The NestedTabs class is extending Canvas, so that you can assign a
> size for the whole lot, and they will take 100% in both dimensions for
> what they are assigned. Let me know how you go with this.
>
>
>
>
> package NestedTabs {
>       import mx.containers.Canvas;
>       import mx.containers.TabNavigator;
>       import mx.events.FlexEvent;
>       import mx.controls.Label;
>
>       public class NestedTabs extends Canvas
>       {
>             private var tn1 : TabNavigator;
>             private var tn2 : TabNavigator;
>
>             private var tn1tab1 : Canvas;
>             private var tn1tab2 : Canvas;
>             private var tn2tab1 : Canvas;
>             private var tn2tab2 : Canvas;
>            
>             public function NestedTabs() : void
>             {
>                   super();
>
>                   // Fire the __onCreationComplete event when the component has been
> created.
>                   this.addEventListener(FlexEvent.CREATION_COMPLETE,
> __onCreationComplete);
>             }
>            
>             private function __onCreationComplete(_event : FlexEvent) : void
>             {
>                   var tn1 : TabNavigator = new TabNavigator();
>                   tn1.percentHeight = 100;
>                   tn1.percentWidth = 100;
>                  
>                   var tn1tab1 : Canvas = new Canvas();
>                   tn1tab1.label = "Welcome";
>                   tn1.addChild(tn1tab1);
>                  
>                   var tn1tab2 : Canvas = new Canvas();
>                   tn1tab2.label="Hello";
>                   tn1.addChild(tn1tab2);
>                  
>                   var tn2 : TabNavigator = new TabNavigator();
>                   tn2.percentHeight = 100;
>                   tn2.percentWidth = 100;
>                  
>                   var tn2tab1 : Canvas = new Canvas();
>                   tn2tab1.label = "wefwe";
>                   tn2.addChild(tn2tab1);
>                  
>                   var tn2tab2 : Canvas = new Canvas();
>                   tn2tab2.label = "wefwe333";
>                   tn2.addChild(tn2tab2);
>                  
>                   tn1tab1.addChild(tn2);
>                  
>                   this.addChild(tn1);
>                   this.setVisible(true);
>             }
>       }
> }
>
>
>
>
> Regards,
> Graham Weldon
> Web Development Manager
> Object Connections
>
>
> --- In [email protected], "rigidcode" <twonests@> wrote:
> >
> >
> > I'm trying to make nested TabNavigators in Actionscript (NOT in mxml).
> > Just two- an outer TabNavigator and, on one of it's tab's canvas's, an
> > inner one.  Sounds simple right? 
> >
> > I reduced it to a smaller reproducable version of the error, here is
> > what I'm doing in my Application:
> >
> > var t:TabNavigator = new TabNavigator();
> > t.width=800;
> > t.height=600;
> > t.creationPolicy='all'; //tried this to fix
> >
> > var tab1:Canvas = new Canvas();
> > tab1.label='Welcome';
> > t.addChild(tab1);
> >
> > var tab2:Canvas = new Canvas();
> > tab2.label='Hello';
> > t.addChild(tab2);
> >
> > var tn2:TabNavigator = new TabNavigator();
> > tn2.creationPolicy='all';
> > var tn2tab1:Canvas = new Canvas();
> > tn2tab1.label='wefwe';
> > tn2.addChild(tn2tab1);
> >
> > var tn2tab2:Canvas = new Canvas();
> > tn2tab2.label='wefwe333';
> > tn2.addChild(tn2tab2);
> >
> > tab1.addChild(tn2);
> >
> > this.addChild(t);
> >
> >
> > The tabs display fine initially, and then here is the exception I get
> > when I click on any tab (either on the inner tabnavigator or the outer
> > one):
> > TypeError: Error #1009: null has no properties.
> >       at
> >
>
mx.managers::HistoryManager$/save()[C:\dev\beta2\sdk\frameworks\mx\managers\HistoryManager.as:554]
> >       at
> >
>
mx.containers::ViewStack/mx.containers:ViewStack::commitSelectedIndex()[C:\dev\beta2\sdk\frameworks\mx\containers\ViewStack.as:1052]
> >       at
> >
>
mx.containers::ViewStack/mx.containers:ViewStack::commitProperties()[C:\dev\beta2\sdk\frameworks\mx\containers\ViewStack.as:620]
> >       at
> >
>
mx.containers::TabNavigator/mx.containers:TabNavigator::commitProperties()[C:\dev\beta2\sdk\frameworks\mx\containers\TabNavigator.as:325]
> >       at
> >
>
mx.core::UIComponent/validateProperties()[C:\dev\beta2\sdk\frameworks\mx\core\UIComponent.as:5007]
> >       at
> >
>
mx.managers::LayoutManager/validateProperties()[C:\dev\beta2\sdk\frameworks\mx\managers\LayoutManager.as:496]
> >       at
> >
>
mx.managers::LayoutManager/mx.managers:LayoutManager::doPhasedInstantiation()[C:\dev\beta2\sdk\frameworks\mx\managers\LayoutManager.as:635]
> >       at
> >
>
mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher2()[C:\dev\beta2\sdk\frameworks\mx\core\UIComponent.as:7379]
> >       at
> >
>
mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher()[C:\dev\beta2\sdk\frameworks\mx\core\UIComponent.as:7322]
> >       at
> >
>
mx.core::UIComponent/setFocus()[C:\dev\beta2\sdk\frameworks\mx\core\UIComponent.as:5814]
> >       at
> >
>
mx.managers::FocusManager/setFocus()[C:\dev\beta2\sdk\frameworks\mx\managers\FocusManager.as:375]
> >       at
> >
>
mx.managers::FocusManager/mx.managers:FocusManager::mouseDownHandler()[C:\dev\beta2\sdk\frameworks\mx\managers\FocusManager.as:1164]
> >
> > Is this a bug in Flex 2?
> >
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to