58
CHAPTER 3
Figure 3-22. Our complete form
23. Click the base state in the States panel to jump back to the base state (Figure 3-23).
Figure 3-23. States panel showing the base and
ContactMe states
59
WORKING WITH STATES
If all things work out well, you should see the bio text area that we created earlier.
24. Select the Send Email button. In the properties, to control what we want to happen when the
button is clicked, we place the action in the On click property field. In this case, we want to
change the current state. Type currentState='contactMe' in this field (Figure 3-24).
Figure 3-24. Changing the state
25. Jumping back to the ContactMe state, you can do the same for the Return to About Me button.
This time, since we have not given the base state a name, we can leave the name area blank. It
will look like Figure 3-25.
Figure 3-25. Properties for the button that
switches to back state
60
CHAPTER 3
Styling the project
Now it??™s time to turn our attention to styling the project. The most commonly used component in this
Flex application is the Panel, so we will be focusing our styling on this component. The other components
will be largely unstyled.
In this project we have used the Panel component multiple times and in different ways. It is used as a
large component that holds the entire project and also as a series of smaller components that hold
our text. We may want to have different styling for each of these two cases, but if we use the technique
that we used in Chapter 2, where we exported all the CSS at once, all Panel components will get
the same styling.
Pages:
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65