<< Chapter < Page Chapter >> Page >

In addition, in design mode, the lower-right pane becomes a property window.You can select a component in the design pane and then set various properties such as font, color, etc., in the properties window.

XML code is automatically updated

When you drag a component into the design pane and set properties on that component, the XML code is automatically updated to reflect the addition of thatcomponent with the specified properties. Therefore, when using Flash Builder 4 in design mode,you can largely avoid having to write raw XML code.

Flash Builder 4 versus the free open-source SDK

This visual design capability is probably the most important feature of Flash Builder 4 that separates it from the free open-source Flex 3 and Flex 4 SDKs. Flash Builder4 lets you design your layout visually and it writes much of the XML code for you.

Documentation

The Adobe site provides extensive online documentation for Flex, Flash Builder, and ActionScript. You will find numerous links to documentationin Resources . This is where you go to learn how to use the Flex language in detail.

Documentation format

In its default form, much of the documentation is divided into three frames, two stacked vertically on the left and one on the right. If you select All Packages and Frames (or something similar) at the top of the rightmost frame, you will see Flex XML elements (classes) listed in the lower-left frame.

Select No Frames

If you select No Frames at the top, (which is not always available) the two frames on the left will disappear. This is useful if you want to use the Find capability of your browser to search for a word in the right frame. You can restore thethree-frame format by selecting Frames at the top of the page.

Select a class

If you select a class, such as Application , in the lower-left frame, information about that class appears in the rightmost frame. If you find two ormore classes with the same name in the lower-left frame, one probably refers to the Flex 3 version of the class and the other probably refers to the Flex 4version of the class. You must be very careful to make certain that you know which you are reading about. Reading about one and thinking that you are readingabout the other can lead to very frustrating programming errors.

Styles

Many of the components in Flex 3 have a variety of styles that can be applied to the component either through the specification ofattributes in the XML element or the use of a Style element that resembles a style sheet. (That is much less true for Flex 4, which takes a different approach.) The Flex 3 example that I will explain in the next section will illustrate the relationship among the following properties and styles for the Application element :

  • backgroundColor
  • backgroundGradientColors
  • backgroundAlpha

Discussion and sample code

The Application element (see Listing 2) is a container into which you can place other components including other containers. Future lessons will be concerned withthe containment properties of the Application element. In this lesson, I will concentrate on the properties and styles listed above that can be applied to that element.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Introduction to xml. OpenStax CNX. Dec 02, 2014 Download for free at https://legacy.cnx.org/content/col11207/1.18
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to xml' conversation and receive update notifications?

Ask