My code looks somrthing like this
<mx:TabNavigator id="tbNavigator" />
I am not able to access the tbNavigator in the samplefunction. It is null.
Can anybody help me in knowing how mx components can be accessed in fx:script
Any help or suggestions is highly appreciated. !!!!!!!!!!!
When is your script being called? It can't be called until during or after the CreationComplete event, because there are no guarantees components have been created until then.
I have included the above component as swc in my main mxml.
I am calling the samplefunction on creationcomplete of main mxml
Unless you have set CreationPolicy="all" on the main mxml, the CreationComplete event for it only means that the main mxml component has been created, all child components are not necessarily created. You should either set that in the application definition, or call samplefunction in the createionComplete event for the component in the swc.