Luckly i was doing something last week that i think can help you.
(or at least give you some directions)
here is the code. try change the tabs to see the resize.
i dont know yet how to find the amount to shrink automaticly... if
you or someone find the answer and share with us that would be nice!
Luís Eduardo.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:states>
<mx:State name="toCourses" />
</mx:states>
<mx:transitions>
<mx:Transition fromState="" toState="toCourses">
<mx:Sequence target="{win}">
<mx:SetPropertyAction target="{tn}" name="visible"
value="false"/>
<mx:Resize
widthBy="-200"
heightBy="-200"
duration="1000"
easingFunction="{Quintic.easeInOut}"/>
<mx:SetPropertyAction target="{tn}" name="selectedIndex"
value="1"/>
<mx:SetPropertyAction target="{tn}" name="visible"
value="true"/>
</mx:Sequence>
</mx:Transition>
<mx:Transition fromState="toCourses" toState="">
<mx:Sequence target="{win}">
<mx:SetPropertyAction target="{tn}" name="visible"
value="false"/>
<mx:Resize
widthBy="200"
heightBy="200"
duration="1000"
easingFunction="{Quintic.easeInOut}"/>
<mx:SetPropertyAction target="{tn}" name="selectedIndex"
value="0"/>
<mx:SetPropertyAction target="{tn}" name="visible"
value="true"/>
</mx:Sequence>
</mx:Transition>
</mx:transitions>
<mx:TitleWindow title="Shrink Test" id="win" width="600" height="500">
<mx:TabNavigator id="tn" width="100%" height="100%">
<mx:Canvas label="Students" width="100%" height="100%"
show="changeStudents()">
</mx:Canvas>
<mx:Canvas label="Courses" width="100%" height="100%"
show="changeCourses()">
</mx:Canvas>
</mx:TabNavigator>
</mx:TitleWindow>
<mx:Script>
<![CDATA[
import mx.effects.easing.Quintic;
public function changeCourses():void {
this.currentState = "toCourses";
}
public function changeStudents():void {
this.currentState = "";
}
]]>
</mx:Script>
</mx:Application>
munene_uk escreveu:
> --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com>, "Manish Jethani"
> <[EMAIL PROTECTED]> wrote:
> >
> > Set resizeToContent on the tab navigator to true.
> >
> > On 4/22/07, munene_uk <[EMAIL PROTECTED]> wrote:
> > > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com>, "munene_uk" <munene_uk@> wrote:
> > > >
> > > > i've got two canvases in a tabnavigator which are named students and
> > > > courses
> > > >
> > > > the student canvas contains alot more information than the courses
> > > > canvas
> > > > my idea is that when the user click on the course tab the
> tabnavigator
> > > > should resize(shrink) to fit.
> > > > does anyone know how i can achieve this?
> > > >
> > > > my other question is can i achieve the same effect without having to
> > > > switch states instead tell the tab navigato to resize itself
> > > >
> > >
> > > can anyone please offer some advice on how i can achieve this?
> > >
> > >
> > >
> > >
> > > --
> > > Flexcoders Mailing List
> > > FAQ:
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>
> > > Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> <http://www.mail-archive.com/flexcoders%40yahoogroups.com>
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> >
> thanks for the reply but for some reason it doesn't seem to work can
> you maybe exaplin to me in a bit more detail how this should be
> implemented?
>
>