A A
RSS

Flex examples(1)

Fri, Dec 8, 2006

Programming

We discussed some small examples today. In this topic I will give a short description of the things I showed you today. You can view the code for each example by right clicking.

Example 1

You can easily make a variable Bindable in flex, just add the [Bindable] keyword. Example 1 shows a list that is bound to two components: a datagrid and a combobox. Everytime the list changes the components change too.

link

Example 2

This example demonstrates the use of different files to have less complexity in your application. In some flex projects I saw that a lot is being done in the main mxml file, resulting in long an overly complex code.

The files

  • UserList.as
    Manages a small list of users. The userlist class has a bindable property called list. This property is used by UserEditor.mxml
  • UserEditor.mxml
    A small simple editor for the users. Makes use of the userlist for managing the list
  • Example2.mxml
    Uses two usereditors (this offcourse for demonstration purposes)

link

Example 3

Validators: You can use validators to check data in fields. This is an example I copied from Adobe.

link

Example 4

Demonstrates how to create you own events (a request from Niels) . This is useful when one component needs to know whether another component has changed. In this example a login screen sends an event if the user is succesfully logged in. This example uses the component fireevent.mxml.
link

Example 5

A beginning of a better example that reads xml in actionscript, not by using mxml. Later this example will use classes for this. (Does not work on this server yet, the better example will work)

Popularity: 5% [?]

0 Comments For This Post

1 Trackbacks For This Post

  1. Model(Locator), easy way to manage your data at Web 2.0 Log Says:

    [...] After a hard day of work, where we overcome some problems I focused some more on the architecture of our application. After Raymond blogged some examples about bindings and events, I’ll put some design patterns against it. [...]