Your component containing the buttons can dispatch its own custom events (e.g. "back" and "next").

The component containing the states just needs to listen to the events emitted:

<myNavButtonComponent back="currentState='step1';" next="currentState='step2';" />

This should be more help:

http://livedocs.macromedia.com/labs/1/flex20beta3/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001406.html

-George

On 5/23/06, Ethan Miller <[EMAIL PROTECTED]> wrote:
Greetings -

Say I have a document (itself a custom component) called wizard.mxml.
This document contains a pair of buttons for navigating steps in a
wizard like this:

<mx:Button label="back" click="currentState='step1'"/>
<mx:Button label="next" click="currentState='step3'"/>

(Also in wizard.mxml are the states 'step1' and 'step3').

Buttons work fine when all are in the same document. However, if I
move the buttons to a custom component, the return errors saying
"Unknown State: 'step1'", etc.

Seems I need to reference the component that the the states are in.
I've tried changing the click action in the buttons ala:

<mx:Button label="back" click="currentState='wizard.step1'"/>

To no avail. So, question, how do I control states in one custom
component from another?

thanks, ethan









--
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