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 --------------------~--> 
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/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