ActionScript's powerful XML support is based on E4X. E4X stands for ECMAScript for XML and is a Document Object Model (DOM) interface for XML. E4X makes XML a first-class citizen in ActionScript.
Thursday, July 2, 2009
Wednesday, June 24, 2009
The data that a user enters in a user interface control might or might not be appropriate for the application. In Adobe Flex applications, you use a validator to ensure the values in the fields of a form meet certain criteria. For example, you can use a validator to ensure that a user enters a valid phone number value, to ensure that a String value is longer than a set minimum length, or ensure that a ZIP code field contains the correct number of digits.
Included Validators in the
- StringValidator - validates input as a string
- RegExpValidator - validates input against a regular expression
- NumberValiator - validates input is a number
- EmailValidator - validates input is in valid email address format
- Date Validator - validates input is in valid date format
- ZipCodeValidator - validates input is in zip code format
- CurrencyValidator - validates input is a valid currency expression
- PhoneNumberValidator - validates input is in valid phone number format
- CreditCardValidator - validates input is in valid credit card format
Thursday, June 11, 2009
Timeris a utility class in the
flash.utilspackage. A timer's job is to fire off events at specified intervals.
The below ActionScript shows how to create a
Timerinstance and start it.
// create a timer which fires every second (1000 ms)
var timer:Timer = new Timer( 1000 );
// add a listener to the timer
timer.addEventListener( TimerEvent.TIMER, handleTimerEvent );
// start the timer
Learn more about the ActionScript Timer at Flex After Dark...
Tuesday, June 2, 2009
Styles in Flex are a lot like CSS (which can be helpful), but not exactly the same (which can be confusing). Some style properties also support Cascading Style Sheet (CSS) inheritance. CSS inheritance means that if you set the value of a style property on a parent container, a child of that container inherits the value of the property when your application runs.
Learn more about Styles and Stylesheets in Flex at Flex After Dark...
Thursday, May 21, 2009
Flex's RPC package (mx.rpc) defines services for making asynchronous calls to remote services.
Types of RPC services:
- HTTP - make HTTP calls to web servers
- Web Services - call SOAP + WSDL based web-services
- Remoting - call remote object servers such as ColdFusion or Java using BlazeDS
Thursday, May 7, 2009
- Flex Web project - create .swf files that run in Flash Player
- Flex Desktop project - create .air files that run in Adobe AIR-Runtime
- Flex Library project - create .swc library files for use in other Flex projects
Thursday, April 30, 2009
ActionScript requires classes/interfaces to be declared in a package and the explicit import of used classes/interfaces that are not in the same package.
public class ClassName extends SuperClassName implements InterfaceName
Learn more about Object Oriented ActionScript at Flex After Dark...
Monday, April 27, 2009
Learn more about MXML Namespaces at Flex After Dark...
Monday, April 20, 2009
A Menu is created with a call to the
createMenu()function. Of course you'll have to pass some data representing the menu items and structure to the
// create the menu data structure
var menuData:Array = [ "Item 1", "Item 2", "Item 3" ];
// create the menu
var menu:Menu = Menu.createMenu( parent, menuData, false );
// show the menu
Learn more about Menus in Flex at Flex After Dark...
Tuesday, April 14, 2009
A Library is collection of Flex/ActionScript classes and resources compiled to a .swc file.
A library is different than a Flex application in that you cannot launch a library. Rather, a library is a code reuse and packaging mechanism.