Brooks Computing Systems Flash Builder Blog Headline Animator

Sunday, January 2, 2011

Test MulitpleMXML Components

To create a mxml component to test mulitple mxml components create a new mxml component. Create a horizontal group and place as many buttons on the group as you have components to test.

Make unique id's for each button. Create event handlers for all buttons. Don't worry about actions of the events we will take care of that later. For each button create a new corresponding state. I typically label states “sta”+button.text.

Click on a state giving it focus the drag the appropriate component from the components panel onto the state. I typically center the component on the canvas. Now lets return to each event handler and in set the currentState to the associated state. When you click on each button that component should become active.

Make sure to access the newly created component as the default for the mxml application. Typically you drag the newly created component onto the xmxl application in the design view.

This approach will allow you to test multiple components.

I can produce a video of the is same tutorial if enough people express and interest in seeing a video of this nature.

No comments:

Post a Comment