Skip navigation
BIOSMonkey
Currently Being Moderated

Need an event that fires for child containers on tabnavigator change

Oct 22, 2007 6:15 PM

I have a tabnavigator with canvas containers representing pages in a web app. What event can I attach to each canvas container's implementation actionscript file that will fire whenever that canvas comes into view via the tab selection? (sort of like an onload event). This event is used to refresh data for that particular page, so I need it to fetch data whenever the page (tab) is selected.

I do not want to attach any events to the tabnavigator itself so that the implementation is generic at the container level. I tried several events, such as show and creationComplete, but the creationComplete event only fires the first time when the canvas is instantiated.

Maybe this is really easy and I am just missing it somehow...
 
Replies
  • Currently Being Moderated
    Oct 22, 2007 10:49 PM   in reply to BIOSMonkey
    show should be called on the canvas each time that tab for the canvas is selected. so should the updateComplete.

    have you tried that?

    ATTA
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 23, 2007 8:12 AM   in reply to BIOSMonkey
    <mx:Script>
    <![CDATA[

    private function onTabChanged(event:IndexChangedEvent):void
    {
    switch(event.newIndex)
    {
    case 0:
    // Do someting for the first tab
    break;
    case 1:
    // Do someting for the second tab
    break;
    case 2:
    // Do someting for the third tab
    break;
    default:
    // And so on and so forth...
    }
    }

    ]]>
    </mx:Script>


    <mx:TabNavigator id="tabNavigatorMain"
    change="onTabChanged(event)">
    </mx:TabNavigator>
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points