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"
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"
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" <[EMAIL PROTECTED]> 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];
> }
>

__._,_.___

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





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to