Archive for December, 2008

30
Dec

Flex Framework

A lot of people steer clear of the Flex framework because they think it’s complicated. But generally speaking, a framework is just a set of reusable classes that can work together to provide a base for an application.

Take a house as an analogy: every house on the planet has a framework. Each house has a foundation and walls, and those walls can’t stand without the foundation. Once the foundation has been laid and the walls are up, a roof can be applied and the interior designed and implemented, while work continues on the initial foundation.

If we apply this analogy to the Flex framework, we have a stack of logic — the controller logic — that has been made available for communicating with a database, handling security, writing to the file system, and so on. There are also the user interface elements — buttons, canvases, dropdown lists, and so on. All of these also form the foundation of your Flex application — the concrete slab, the timber beams and the bricks with which to build your house.

Flex is easy for web developers to learn because, at its core, it has a lot in common with (X)HTML, CSS, and JavaScript. Suppose you wanted to create a simple web page with a form button. In XHTML you’d type the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Button Example</title>
</head>

<body>
<form method="post" id="example" action="http://www.example.com/">
<input type="button" name="newButton" id="newButton" value="This is a button" onclick="checkForm()" />
</form>
</body>
</html>

Continue reading ‘Flex Framework’

03
Dec

Free Flex components Resources

Flex Component Kit Alpha for Flex 2.0.1
The Flex Component Kit for Flash CS3 allows you to create interactive, animated content in Flash, and use it in Flex as a Flex component. This is an Alpha version that was built for Flex 2.0.1. The final version will be included as part of the Flex 3 SDK. You can watch the presentation at http://adobedev.adobe.acrobat.com/p75214263/ to learn more about the component kit. It includes the steps required to prepare your Flash content for Flex, and examples of various interaction possibilities…. Components here

Flex Components
Check out Tour de Flex – an AIR application that contains samples for the most popular components available to Flash Platform developers.
Components are the building blocks of the Flex framework. With them you are able to prototype, build and deploy your applications in record time.
The open source Flex framework includes a robust set of components and containers right out of the box. On top of the components that come with the Flex framework, there are a number of commercial components available, as well as community components available.

Continue reading ‘Free Flex components Resources’

03
Dec

Flex Using Data Binding to Configure Validators

User input might also define the properties of the validator. In the following example, you let the user set the minimum and maximum values of a NumberValidator:

Code Samples:

<?xml version="1.0"?>

<!-- validators\ConfigWithBinding.mxml -->

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:NumberValidator source="{inputA}" property="text" minValue="{Number(inputMin.text)}"

maxValue="{Number(inputMax.text)}"/>

<mx:TextInput id="inputA"/>

<mx:TextInput id="inputMin" text="1"/>

<mx:TextInput id="inputMax" text="10"/>

</mx:Application>

In this example, you use data binding to configure the properties of the validators. 
03
Dec

Enabling and disabling a validator in Flex

The Validator.enabled property lets you enable and disable a validator. When the value of the enabled property is true, the validator is enabled; when the value is false, the validator is disabled. When a validator is disabled, it dispatches no events, and the validate() method returns null.
For example, you can set the enabled property using data binding, as the following code shows:
Code Samples:

<?xml version="1.0"?>

<!-- validators\EnableVal.mxml --> Continue reading 'Enabling and disabling a validator in Flex'
03
Dec

Flex Using the String Validator

The StringValidator class validates that a string length is within a specified range. The following example ensures that a string is between 6 and 12 characters long:

Code Samples:

<?xml version="1.0"?>
<!-- validators\StringExample.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Form id="membershipForm">
<mx:FormItem id="fullNameItem" label="Full Name">
<!-- Not validated -->
<mx:TextInput id="fullNameInput"/>
</mx:FormItem>
<mx:FormItem id="userNameItem" label="Username">
<mx:TextInput id="userNameInput"/>
</mx:FormItem>
</mx:Form>

<mx:StringValidator source="{userNameInput}" property="text"
minLength="6" maxLength="12"/>
</mx:Application>


Get Adobe Flash playerPlugin by wpburn.com wordpress themes