| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
ok... playing with the trial of flex builder 2. and so far this seems like its gonna be really really sweet. i am pretty excited.
but i have a quick question about the tabnavigator. here is my code: ActionScript Code:
ok. just an fyi. all the code works. no errors in fb2, compiles and runs fine. here is the problem. i am trying to capture the click event on the TAB. in the tabnavigator. currently the way i have it set up, it doesnt capture when i click the TAB. it triggers the event when i click into the CONTENT held within the canvas for that tab. there has to be some hidden event somewhere (or maybe not so hidden -- im new to this). that is triggered so it knows to switch between content in tabs. know what i mean? i have tried MouseEvent.CLICK and EVENT.TAB_CHILDREN_CHANGE (altho this is not really meant for the tabnavigator i dont think). both work the same way as mentioned above. but not the way i need them to work. any suggestions on where to look? or what to try? appreciate all comments and suggestions. thanks.
__________________
tg --- what the hell was i thinking? |
|
|
|
|
|
#2 |
|
Addict
Join Date: Nov 2001
Location: London
Posts: 2,128
|
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
private function changeHandler( event:Event ):void
{
var tabNavigator:TabNavigator = TabNavigator( event.target );
trace("Tab changed to: " + tabNavigator.selectedIndex);
}
]]>
</mx:Script>
<mx:TabNavigator id="tn" width="100%" height="345" x="2" y="1" change="changeHandler( event );">
<mx:Canvas label="Project Information" width="100%" height="100%" id="projData">
</mx:Canvas>
<mx:Canvas label="Project Analysts" width="100%" height="100%" id="projAnalyst">
</mx:Canvas>
<mx:Canvas label="Project Work Time" width="100%" height="100%" id="projTime">
</mx:Canvas>
</mx:TabNavigator>
</mx:Application>
|
|
|
|
|
|
|
|
|
#3 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
excellent.... tried something similar but didnt work.
will try this know. but i have confidence in your code. tink.
__________________
tg --- what the hell was i thinking? |
|
|
|
|
|
#4 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
ok... needed to edit that.... cause im stupid and cant read.
your code works perfect tink. Thanks....... need to look at correct event.... click != change. hah! thanks again.
__________________
tg --- what the hell was i thinking? Last edited by tg; 07-20-2006 at 08:11 PM.. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|