Instead of states, you can use a little binding, like:

<mx:Text x="10" y="10" text="{ScriptsAccordion.selectedChild.label} 
Page Text" width="218" id="text1"/>

Or, create an Array that contains the text that you want to display, 
in the same order as the Accordion children.  You would then 
similarly bind like:

text="{myArray[ScriptsAccordion.selectedIndex]}"

-TH

--- In [email protected], Impudent1 <[EMAIL PROTECTED]> wrote:
>
> I have been playing with flex a bit lately, doing the tutorials, 
some 
> web examples from the blogs (ty all ;p )
> 
> I decided to try to rebuild a basic web page that currently lists 
all 
> the scripts I created for After Effects in Flex2B3.
> 
> What I am stuck on is trying to have an accordion navigator change 
the 
> content in a specific canvas. I currently have setup states to do 
this. 
> Thinking that I would be able to setup a function that would test 
the 
> accordions selected id vs a list of states and change accordingly 
I 
> setup the following:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
layout="absolute">
>      <mx:states>
>          <mx:State name="BackBurnerSubmitUI">
>              <mx:SetProperty target="{text1}" name="text" 
> value="Backburner page text"/>
>          </mx:State>
>          <mx:State name="BackupProject">
>              <mx:SetProperty target="{text1}" name="text" 
> value="BackupProject page text"/>
>          </mx:State>
>          <mx:State name="Calc">
>              <mx:SetProperty target="{text1}" name="text" 
value="Calc 
> page text"/>
>          </mx:State>
>          <mx:State name="DefaultFolders">
>              <mx:SetProperty target="{text1}" name="text" 
value="Default 
> Folders page text"/>
>          </mx:State>
>          <mx:State name="DropFootageTime0">
>              <mx:SetProperty target="{text1}" name="text" 
> value="DropFootage page text"/>
>          </mx:State>
>          <mx:State name="FilmCalc">
>              <mx:SetProperty target="{text1}" name="text" 
> value="Filmcalc page text"/>
>          </mx:State>
>          <mx:State name="FontCollector">
>              <mx:SetProperty target="{text1}" name="text" 
value="Font 
> collector page text"/>
>          </mx:State>
>          <mx:State name="GoWarpStatic">
>              <mx:SetProperty target="{text1}" name="text" 
value="Gowarp 
> page text"/>
>          </mx:State>
>          <mx:State name="Gspot">
>              <mx:SetProperty target="{text1}" name="text" 
value="Gspot 
> page text"/>
>          </mx:State>
>          <mx:State name="ImportExportLayouts">
>              <mx:SetProperty target="{text1}" name="text" 
value="Layouts 
> page text"/>
>          </mx:State>
>          <mx:State name="ImportExportMRU">
>              <mx:SetProperty target="{text1}" name="text" 
value="MRU 
> page text"/>
>          </mx:State>
>          <mx:State name="MusterBatchUI">
>              <mx:SetProperty target="{text1}" name="text" 
> value="Musterbatch page text"/>
>          </mx:State>
>          <mx:State name="MusterSubmitUI">
>              <mx:SetProperty target="{text1}" name="text" 
> value="Mustersubmit page text"/>
>          </mx:State>
>          <mx:State name="RenderAndShutdown">
>              <mx:SetProperty target="{text1}" name="text" 
> value="Rendershutdown page text"/>
>          </mx:State>
>          <mx:State name="SamplerSizerRadio">
>              <mx:SetProperty target="{text1}" name="text" 
> value="Samplersizer page text"/>
>          </mx:State>
>      </mx:states>
> 
>      <mx:Script>
>          <![CDATA[
>              // Import the class that defines the event object.
>              import mx.events.IndexChangedEvent;
>                // set the function
>              private function 
> ScriptsAccChange(event:IndexChangedEvent):void {
>              // set the state to fit the accordion index
>                  if(event.newIndex == 
> 1){currentState="'BackBurnerSubmitUI'"}
>  
>          }
>          ]]>
>      </mx:Script>
> 
>      <mx:Accordion x="10" y="55" width="240" 
resizeToContent="true" 
> id="ScriptsAccordion" change="ScriptsAccChange(event)">
>          <mx:Canvas label="Main Page" width="100%" height="0" 
id="MainPage">
>          </mx:Canvas>
>          <mx:Canvas label="Backburner Submit UI" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10" text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="20" y="35" text="1.0"/>
>              <mx:Label x="64" y="36" text="18, 7, 2004"/>
>              <mx:Label x="156" y="36" text="AE 6.5 +"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Backup Project" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="17, 7, 2004"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:Label x="23" y="50" text="1.2"/>
>              <mx:Label x="64" y="50" text="28, 1, 2006"/>
>              <mx:Label x="166" y="50" text="AE 7"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Calc" width="100%" height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="18, 7, 2004"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:Label x="23" y="50" text="2.0"/>
>              <mx:Label x="70" y="50" text="6, 9, 2006"/>
>              <mx:Label x="150" y="50" text="Mac UI Fix"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Default Folders" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.8"/>
>              <mx:Label x="64" y="35" text="18, 7, 2004"/>
>              <mx:Label x="145" y="35" text="AE 7,Mac Fix"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Drop Footage Time 0" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="20, 6, 2004"/>
>              <mx:Label x="148" y="35" text="AE 6.5 only"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="FilmCalc" width="100%" height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="17, 8, 2004"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Font Collector" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="10, 6, 2005"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Go Warp Static" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="21, 6, 2004"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Gspot" width="100%" height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="21, 6, 2004"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:Label x="23" y="50" text="2.0"/>
>              <mx:Label x="64" y="50" text="23, 1, 2006"/>
>              <mx:Label x="145" y="50" text="AE 7,Mac Fix"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Import/Export Layouts" width="100%" 
> height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="xx, x, 2006"/>
>              <mx:Label x="162" y="35" text="AE 7"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Import/Export MRU" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="xx, x, 2006"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Muster Batch UI" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="xx, x, 2006"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Muster Submit UI" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="xx, x, 2006"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Render and Shutdown" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="25, 11, 2004"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:Label x="23" y="50" text="2.0"/>
>              <mx:Label x="64" y="50" text="20, 1, 2005"/>
>              <mx:Label x="145" y="50" text="AE 7,Mac Fix"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
>          <mx:Canvas label="Sampler Sizer Radio" width="100%" 
height="100%">
>              <mx:Label x="10" y="10" text="Version"/>
>              <mx:Label x="85" y="10    " text="Date"/>
>              <mx:Label x="148" y="10" text="Description"/>
>              <mx:Label x="23" y="35" text="1.0"/>
>              <mx:Label x="64" y="35" text="21, 6, 2004"/>
>              <mx:Label x="156" y="35" text="AE 6.5 +"/>
>              <mx:HRule x="10" y="10" width="220" height="36"/>
>          </mx:Canvas>
> 
>      </mx:Accordion>
> 
>      <mx:Canvas x="258" y="10" width="756" height="40" 
label="Header" 
> id="HeaderCanvas">
>          <mx:Text x="32" y="0" text="These are some scripts I 
created to 
> learn Adobe's Extendscript. They have all been tested but use at 
your 
> own risk." width="654" height="20"/>
> 
> <mx:Text width="700" y="10" x="10">
> <mx:htmlText><![CDATA[
>   Usage is free, but if you wish to give something back, please <a 
> href="http://www.leapfrog-
productions.com/Scripts/A_R_links.html"><font 
> color="#008800">donate to a reputable animal advocacy 
group</a></font> 
> in your area.
> ]]></mx:htmlText>
> </mx:Text>
> 
>      </mx:Canvas>
>      <mx:Canvas x="258" y="58" width="756" height="607" 
id="MainStage" 
> label="MainStage">
>          <mx:Text x="10" y="10" text="main page text" width="218" 
> id="text1"/>
>      </mx:Canvas>
> 
> </mx:Application>
> 
> 
> If you click on the BackBurner Submit UI accordion header, you get 
the 
> actionscript error dialog stating that it has an ArguementError: 
> Undefined state "BackBurnerSubmitUI"
> 
> So I guess the big question I have is: how do you make sure states 
are 
> included in the scope of the function?
> 
> Second question: If you click on the Main accordion header you 
will see 
> it opens a whitespace even tho the height field is set to 0. I 
assume 
> this is because of the resizeToContent="true" flag, but I cannot 
find 
> any way to adjust the whitespace numbers.
> 
> tia and I am glad to find this list resource, In the future I hope 
to be 
> able to leverage Flex with the other adobe suite apps using 
bridgetalk 
> or ajax.
> 
> Impudent1
> LeapFrog Productions
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to