Flex 3 In Action: Free Chapters

DZone 's Guide to

Flex 3 In Action: Free Chapters

· Java Zone ·
Free Resource

We're giving away two free chapters from the new Flex 3 In Action book in association with Manning Publications. Flex 3 in Action is an easy-to-follow, hands-on Flex tutorial. This book goes beyond feature coverage and helps you put Flex to work in real day-to-day tasks. You'll quickly master the Flex API and learn to apply the techniques that make your Flex applications stand out from the crowd.

The chapters included are Working With ActionScript  and Displaying Forms And Capturing User Input

Working With ActionScript 

ActionScript is an extremely powerful object-oriented language about which you can dedicate entire books. In this chapter we’ll focus on ActionScript’s core concepts; obviously you will need to be familiar with them before we get to the more powerful aspects of Flex itself. Speaking of which, you’re probably anxious to get back into Flex, but tackling some ActionScript fundamentals will allow us to pick up the pace and move further forward.

A fundamental concept in any programming language is that of comments, so we’ll begin our discussion with how Flex supports documenting your code.

Download the rest of this chapter here.


Displaying Forms And Capturing User Input

Let’s put our newly acquired understanding of layout and ActionScript to work and apply it to a fundamental operation of any application—capturing user input. As mentioned in chapter 4, even though Flex offers a Form component, its use is optional and you’ll find it functions best as a layout tool. In the land of Flex you are
equipped with control components (usually referred to as controls) that display information and accept user input. Alongside controls are events and event handlers that recognize and respond to user actions, such as clicking a mouse.
When event handler functions run, they access data from whatever source they’ve been instructed; there’s no master Form tag that contains all the inputs as in HTML.

NOTE Say goodbye to the notion of HTML Forms. The optional <Form> tag in Flex does nothing more than lay out UI components called controls.

Remember, you’re not restricted to the set of controls that come with Flex. Unlike HTML, which limits your UI controls to the HTML specification and browser implementation, Flex encourages you to extend an existing control to add more functionality, or create your own, completely new, UI controls from scratch.
One of the teaching approaches this book employs is to show many ways of doing the same thing. From example to example, we’ll use an idea from the previous one, but then change a portion of it to demonstrate an alternative. The alternatives aren’t necessarily any better, they’re just different, but more importantly help you to think with the ActionScript mentality.

A core piece to that understanding is the invaluable id attribute, a handle to an MXML component that allows you to access the values contained by the id attribute.

Download the rest of this chapter here.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}