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
Maybe this is really easy and I am just missing it
Karl_Sigiscar_1971, Oct 23, 2007 8:12 AM
"show" is the first thing I tried, but it will only fire if
the canvas is shown after coming from another sibling (ie another
tab or link in the same navigation control).
I created a small test file here:
http://webpages.charter.net/brandonmb/files/test.mxml that uses a linkbar inside a tabnavigator. In my regular
application, the linkbar is actually another tabnavigator, but this
demonstrates why I don't want to attach any events to the
You will note that the first link under each main tab has a
show event defined. This will only fire if you click another
sibling, then come back to it.
I need an event to fire ANY time the canvas (ie the content
of each subtab) comes into view, for whatever reason. This event
will trigger code to fetch and refresh data on the page.
You would intuitively think that "show" would do just this,
but it doesn't (unless I am doing something wrong). It should fire,
for example, when the user clicks the main tab, and the first tab
is selected by default. It should also fire if I click the same
link it is currently on (but I think this has to do with the fact
that Flex disables the current link for some reason, instead of
showing it as a 'selected' color).
private function onTabChanged(event:IndexChangedEvent):void
// Do someting for the first tab
// Do someting for the second tab
// Do someting for the third tab
// And so on and so forth...