Well it seems I'm in a alone in this thread but I'll post the solution I've
found so far...
The real problem was that when you extend the class Tab in order to a custom
TabNavigator you have to add a TAB_CREATED event to work around the glitch.
Once the TAB.TAB_CREATED(refer to the button in the tabbar) is triggered in
my application I have to make sure its the first tab added to the
tabNavigator and then set the tab.selected to true manually.

In my application
           public function tabIsCreated(evt:FlexEvent):void {
               //WorkAround of a glitch when there's no child in the
TabNavigator the button don't get selected
               if (evt.target is Button && chatTabs.numChildren == 1) {
                   Button(evt.target).selected = true
               }
           }

In tab class
       public static const TAB_CREATED:String = "btnTabCreated2";
       public function ViewTab(){
           super();
           addEventListener(FlexEvent.CREATION_COMPLETE,
myCreationComplete);
       }
       private function myCreationComplete(event:Event):void {
            dispatchEvent(new FlexEvent(TAB_CREATED,true,false))
         }

Well I hope this migth help someone else.

On 2/17/07, Guillaume Malartre <[EMAIL PROTECTED]> wrote:

Sorry just updated the .swf online :P
the glitch is now online

On 2/17/07, Guillaume Malartre <[EMAIL PROTECTED] > wrote:
>
> I'll start this message with the problem:
> My chat application:
> http://ded692cale.maximumasp.com/NetMaths111/SWF/ExplorationsBeta/NMChat.swf
>
>
> When I open a client by double-clicking in the list(in order to work you
> need to login 2 user) and then I close it with a removeChildren() I'll get a
> glitch with the tab button in the TabBar.
> The button doesn't appear white like he should be (selected), I tried
> selectedIndex etc.. And everything seems to be well coded. Anyone got a
> suggestion?
>
>             private function createTab(name:String):void {
>                 var bool:Boolean = true
>                 for (var x:Object in allChatConversation) {
>                     if (x == name && allChatConversation[x] != null) {
>                         bool = false
>                     }
>                 }
>                 if (bool) {
>                     chatTabs.visible = true
>                     var chatRoom:NMChatRoom = new NMChatRoom()
>                     chatRoom.id = "chatRoom"
>                     chatTabs.addChild(chatRoom)
>                     chatRoom.label = name
>                     allChatConversation[name] = chatRoom //this is an
> object to keep a track on all the chatRoom opened
>                     chatList.setFocus()
>                     if (chatTabs.numChildren == 1) {
>                          chatTabs.visible = true
>                     }
>                     chatTabs.selectedChild = allChatConversation[name]
>                 }
>             }
> selectedChild work well when there's already at least one child created
> but when there is zero child the glitch happen.
>
> --
> Merci,
> Guillaume
>
> Guillaume Malartre
> Programmeur-Analyste, Scolab
> 514-528-8066, 1-888-528-8066
>
> Besoin d'aide en maths?
> www.NetMaths.net




--
Merci,
Guillaume

Guillaume Malartre
Programmeur-Analyste, Scolab
514-528-8066, 1-888-528-8066

Besoin d'aide en maths?
www.NetMaths.net




--
Merci,
Guillaume

Guillaume Malartre
Programmeur-Analyste, Scolab
514-528-8066, 1-888-528-8066

Besoin d'aide en maths?
www.NetMaths.net
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to