tabnavigator gets messed up

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

tabnavigator gets messed up

FlexCoders mailing list
Using FB4 with sdk4.0.

My UI gets user details, then shows a tabbed interface.  Can view any tabs, then get new user details.

When the 2nd (and subsequent users) are chosen, the tabbed interface then is messed up with the details of the 3rd tab being displayed over the top of the details of the default (1st) tab.  It's just a visual representation that looks wrong but it's quite messy looking.

Any pointers on what might be causing this?
 

Reply | Threaded
Open this post in threaded view
|

Re: tabnavigator gets messed up

FlexCoders mailing list
Show some code sample.

Sent from my iPhone

> On Jun 29, 2015, at 10:04 PM, [hidden email] [flexcoders] <[hidden email]> wrote:
>
> Using FB4 with sdk4.0.
>
> My UI gets user details, then shows a tabbed interface.  Can view any tabs, then get new user details.
>
> When the 2nd (and subsequent users) are chosen, the tabbed interface then is messed up with the details of the 3rd tab being displayed over the top of the details of the default (1st) tab.  It's just a visual representation that looks wrong but it's quite messy looking.
>
> Any pointers on what might be causing this?
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: tabnavigator gets messed up

FlexCoders mailing list
Thanks.  I'm working on doing that.  I can't really post the code that's failing, it's part of an application that's far too big to post, but have built a smaller example and can't seem to get it to fail.

I had been setting the selectedChild/index manually and took that out but it still fails.  The code only manipulates the tab contents via mx:state settings.  So, it's frustrating in that I don't really do anything to manipulate tab contents (which would have potential to be my bug).
Reply | Threaded
Open this post in threaded view
|

RE: tabnavigator gets messed up

davidcoleman
This post has NOT been accepted by the mailing list yet.

Without seeing your code I suspect that you are setting the selected index and then adding children to that view, trusting that it is actually changed.  Since tab contents are managed via states, then the flex framework will execute a lot of code automatically.  If you are not careful to sync up with the change of state, test if this will cause a tab change, if so, make sure that your current tab is the right selected index, or wait for a CHANGE event to occur.

 

Also keep an eye on the actual state of your navigator with:

 

Inherited

currentStateChange

Dispatched after the view state has changed.

UIComponent

 

Inherited

currentStateChanging

Dispatched after the currentState property changes, but before the view state changes.

 

As well as:

 

Inherited

stateChangeComplete

Dispatched after the component has entered a new state and any state transition animation to that state has finished playing.

UIComponent

 

Inherited

stateChangeInterrupted

Dispatched when a component interrupts a transition to its current state in order to switch to a new state.

 

The fact that you have one view’s contents laid over another one, tells me that almost certainly there is code which manually adds children/elements to the stage.  As such, trusting the flex state engine will cause your pure AS3 code to almost always be winning the race against the flex framework as the flex framework is powerful and impressively fast, but still slower than hand-coded as3.

 

TLDR: check that the navigator is actually in the state you think it is in before you do anything with the selectedChild.

 

Good luck!

 

From: FlexCoders mailing list [via FlexCoders] [mailto:[hidden email]]
Sent: Wednesday, July 1, 2015 10:54 PM
To: davidcoleman <[hidden email]>
Subject: Re: tabnavigator gets messed up

 

Thanks.  I'm working on doing that.  I can't really post the code that's failing, it's part of an application that's far too big to post, but have built a smaller example and can't seem to get it to fail.

I had been setting the selectedChild/index manually and took that out but it still fails.  The code only manipulates the tab contents via mx:state settings.  So, it's frustrating in that I don't really do anything to manipulate tab contents (which would have potential to be my bug).


If you reply to this email, your message will be added to the discussion below:

http://flexcoders.10928.n7.nabble.com/tabnavigator-gets-messed-up-tp112455p112457.html

To start a new topic under FlexCoders, email [hidden email]
To unsubscribe from FlexCoders, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

RE: tabnavigator gets messed up

davidcoleman
This post has NOT been accepted by the mailing list yet.
In reply to this post by FlexCoders mailing list

Without seeing your code I suspect that you are setting the selected index and then adding children to that view, trusting that it is actually changed.  Since tab contents are managed via states, then the flex framework will execute a lot of code automatically.  If you are not careful to sync up with the change of state, test if this will cause a tab change, if so, make sure that your current tab is the right selected index, or wait for a CHANGE event to occur.

 

Also keep an eye on the actual state of your navigator with:

 

Inherited

currentStateChange

Dispatched after the view state has changed.

UIComponent

 

Inherited

currentStateChanging

Dispatched after the currentState property changes, but before the view state changes.

 

As well as:

 

Inherited

stateChangeComplete

Dispatched after the component has entered a new state and any state transition animation to that state has finished playing.

UIComponent

 

Inherited

stateChangeInterrupted

Dispatched when a component interrupts a transition to its current state in order to switch to a new state.

 

The fact that you have one view’s contents laid over another one, tells me that almost certainly there is code which manually adds children/elements to the stage.  As such, trusting the flex state engine will cause your pure AS3 code to almost always be winning the race against the flex framework as the flex framework is powerful and impressively fast, but still slower than hand-coded as3.

 

TLDR: check that the navigator is actually in the state you think it is in before you do anything with the selectedChild.

 

Good luck!

 

 

From: FlexCoders mailing list [via FlexCoders] [mailto:[hidden email]]
Sent: Wednesday, July 1, 2015 10:54 PM
To: davidcoleman <[hidden email]>
Subject: Re: tabnavigator gets messed up

 

Thanks.  I'm working on doing that.  I can't really post the code that's failing, it's part of an application that's far too big to post, but have built a smaller example and can't seem to get it to fail.

I had been setting the selectedChild/index manually and took that out but it still fails.  The code only manipulates the tab contents via mx:state settings.  So, it's frustrating in that I don't really do anything to manipulate tab contents (which would have potential to be my bug).


If you reply to this email, your message will be added to the discussion below:

http://flexcoders.10928.n7.nabble.com/tabnavigator-gets-messed-up-tp112455p112457.html

To start a new topic under FlexCoders, email [hidden email]
To unsubscribe from FlexCoders, click here.
NAML