Re: [flexcoders] Re: Accordion state change?

2006-06-20 Thread Impudent1
Tim Hoff wrote:
 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]}
 


Ah, nice idea ty :)

What I ended up doing last eve was dumping all the states and replacing 
them as a viewstack. Then I could just go:

change=vs.selectedIndex = Acc.selectedIndex

only caveat seems to be you have to have the same # of canvas' in both 
or you can go out of bounds with a selection.

Impudent1
LeapFrog Productions



 Yahoo! Groups Sponsor ~-- 
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/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/
 





[flexcoders] Re: Accordion state change?

2006-06-19 Thread Tim Hoff
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 flexcoders@yahoogroups.com, 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%