Couldn't tell where your menu handler is.  If not in the main 
application you would have to use:

Application.application.stateManagerCurrentState = [EMAIL PROTECTED];

-TH

--- In [email protected], "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
> 
> Jeremy,
> 
> Have you tried something like this?  (See Red Code Lines)
> 
> - TH
> 
> main.mxml
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> "
> xmlns="*"
> xmlns:widgets="components.widgets.*"
> xmlns:stateManager="components.managers.*" layout="absolute">
> 
> 
> // put in script block
> [Bindable]
> public var stateManagerCurrentState : String ="EditListing";
> 
> <!-- SEARCH WIDGET -->
> <widgets:widgetSearch x="0" y="0" />
> 
> <!-- MENU BAR WIDGET -->
> <widgets:clockWidget x="0" y="50" />
> 
> <!-- STATE MANAGER -->
> <stateManager:stateManager x="0" y="94" id="mainDisplay"
> currentState={stateManagerCurrentState} />
> 
> </mx:Application>
> 
> stateManager.mxml
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> "
> xmlns:contacts="components.views.contacts.*"
> xmlns:content="components.views.content.*"
> xmlns:education="components.views.education.*"
> xmlns:marketing="components.views.marketing.*"
> xmlns:reports="components.views.reports.*"
> xmlns:setup="components.views.setup.*"
> xmlns:today="components.views.today.*"
> xmlns:tools="components.views.tools.*"
> xmlns:transactions="components.views.transactions.*" width="100%"
> height="100%" >
> <mx:states>
> <mx:State name="mainState"/>
> 
> <!-- EDIT LISTING STATE -->
> <mx:State name="EditListing" id="EditListing" basedOn="mainState">
> <mx:AddChild>
> <transactions:viewEditListing />
> </mx:AddChild>
> </mx:State>
> 
> <!-- EDIT SALE STATE -->
> <mx:State name="EditSale" id="EditSale" basedOn="mainState">
> <mx:AddChild>
> <transactions:viewEditSale />
> </mx:AddChild>
> </mx:State>
> 
> </mx:states>
> </mx:Canvas>
> 
> 
> menuHandler function-
> import components.managers.stateManager;
> private function menuHandler(event : MenuEvent) : void {
> 
> stateManagerCurrentState = [EMAIL PROTECTED];
> }
> 
> 
> --- In [email protected], "Jeremy Rottman" <rottmanj@>
> wrote:
> >
> > I have already done this. It is when I try to manage my states 
out of
> > parentapplication where I get the problem. I use the 
stateManager.mxml
> > file to handle the states, so I can easily manage the code. When 
I use
> > the function on my menubar to change the state is where I get the
> error.
> >
> >
> > Here is my code
> >
> > main.mxml
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> > xmlns="*"
> > xmlns:widgets="components.widgets.*"
> > xmlns:stateManager="components.managers.*" layout="absolute">
> >
> >
> >
> > <!-- SEARCH WIDGET -->
> > <widgets:widgetSearch x="0" y="0" />
> >
> > <!-- MENU BAR WIDGET -->
> > <widgets:clockWidget x="0" y="50" />
> >
> > <!-- STATE MANAGER -->
> > <stateManager:stateManager x="0" y="94" id="mainDisplay" />
> >
> > </mx:Application>
> >
> > stateManager.mxml
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml";
> > xmlns:contacts="components.views.contacts.*"
> > xmlns:content="components.views.content.*"
> > xmlns:education="components.views.education.*"
> > xmlns:marketing="components.views.marketing.*"
> > xmlns:reports="components.views.reports.*"
> > xmlns:setup="components.views.setup.*"
> > xmlns:today="components.views.today.*"
> > xmlns:tools="components.views.tools.*"
> > xmlns:transactions="components.views.transactions.*" width="100%"
> > height="100%" currentState="EditListing">
> > <mx:states>
> > <mx:State name="mainState"/>
> >
> > <!-- EDIT LISTING STATE -->
> > <mx:State name="EditListing" id="EditListing" 
basedOn="mainState">
> > <mx:AddChild>
> > <transactions:viewEditListing />
> > </mx:AddChild>
> > </mx:State>
> >
> > <!-- EDIT SALE STATE -->
> > <mx:State name="EditSale" id="EditSale" basedOn="mainState">
> > <mx:AddChild>
> > <transactions:viewEditSale />
> > </mx:AddChild>
> > </mx:State>
> >
> > </mx:states>
> > </mx:Canvas>
> >
> >
> > menuHandler function-
> > import components.managers.stateManager;
> > private function menuHandler(event : MenuEvent) : void {
> >
> > stateManager.currentState = [EMAIL PROTECTED];
> > }
> >
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Protect your PC from spy ware with award winning anti spy technology. It's free.
http://us.click.yahoo.com/97bhrC/LGxNAA/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