Which event gets fired when you click on ViewNavigator in Flex Mobile app?
<s:ViewNavigator id="trends" label="Trends" width="100%" height="100%" firstView="views.TrendsView" icon="@Embed('assets/column-chart-icon32.png')"/>
<s:ViewNavigator id="attach" label="Attach" width="100%" height="100%" firstView="views.AttachView" icon="@Embed('assets/paperclip-icon32.png')"/>
Now, I know if you click on "trends" then firstView "views开发者_Go百科.TrendsView" will be shown. Now you are in that view and click again on "trends" (bottom nav bar) which event will flex dispatch?
This might help you: http://opensource.adobe.com/wiki/display/flexsdk/View+and+ViewNavigator
According to this document, your class "views.TrendsView" should dispatch an event of type ViewNavigatorEvent.VIEW_ACTIVATE when "trends" is clicked again.
If you want to listen on the view navigator for events, I've found these tend to work:
elementAdd="mainNavigator_elementAddHandler(event)"
elementRemove="mainNavigator_elementAddHandler(event)"
In this case my view navigator is called 'mainNavigator'. I've also done this:
ChangeWatcher.watch(mainNavigator,'length', mainNavigator_lengthChangeHandler, false, true);
But I don't know if that's quite as clean.
@Davz, viewActivate dispatch only once i.e. first time you click on "Trends". Once you are in "Trends" and click again it will not fire viewActivate event since that view is activate one. I think flex don't fire any event on active view i.e. "trends" tab is active and you click again on "trends" on bottom navigation bar (in TabViewNavigatorApplication)
精彩评论