Set/assign the state( currentState="Oct2010" ) inside creationComplete
handling method.

Ex.
protected function
application1_creationCompleteHandler(event:FlexEvent):void
{
// TODO Auto-generated method stub
this.currentState = " Oct2010";
}
May be all the states might have not laid-out while executing  <mx:FormItem
includeIn="Apr2012">

Its my guess. Do reply with your results.

Thanks

On Tue, Feb 7, 2012 at 12:39 AM, bu4fred <fred.se...@adventistcare.org>wrote:

> **
>
>
> I'm migrating a flex 3.0 application to 4.0 (or 4.5, doesn't matter much)
> and I want to use the new state features of includeIn and excludeFrom. I
> have a user defined base class in mxml and i inherit from that for my
> 'working' classes. I have this code in my baseclass
>
> <mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009";
> xmlns:s="library://ns.adobe.com/flex/spark"
> xmlns:mx="library://ns.adobe.com/flex/mx"
> xmlns:com="components.*"
> currentState="Oct2010">
>
> <mx:states>
> <s:State id="Oct2010" name="Oct2010"/>
> <s:State name="Oct2011"/>
> <s:State name="Apr2012"/>
> </mx:states>
> . . .
>
> ------------- working class contains -----------------------------
> <mx:FormItem includeIn="Apr2012">
> ...
> </mx:FormItem>
> ---- and the error is --------------------------------------------
>
> State 'Apr2012' was referenced without being declared. A.mxml line 66
> /MdsClientBeta1/src/sections Flex Problem
>
> ------------------- comments ------------------------
> I tried s:states rather than mx:states but it could not resolve name
> Must s:states be used only in s: components or can they be used in mx
> components?
>
>  
>

Reply via email to