Archive

Archive for the ‘Flex 3 Features’ Category

Flex and mobile, a whitepaper to create Flex application for mobile devices

February 17, 2010 Leave a comment

Adobe has realesed the first whitepaper where it explains that:

” The mobile version of the Flex framework (code-named “Slider”) will provide structure and guidelines for creating application experiences that translate well across platforms, and make it easy to build adaptable multiscreen applications. “Slider” may be used by a broad spectrum of Adobe customers, from traditional media brands and agencies to internal IT organizations. Initial applications built with “Slider” will range from simple companion applications that complement existing web or desktop applications, to more complex contextual applications where multiscreen delivery is a core requirement from the outset.

Flex and Mobile whitepaper.

Categories: Flex 3 Features

Disabling event in Flex

December 18, 2009 Leave a comment

From InsideRIA.

Flex does not provide a way to temporarily disable event listeners and re-enable them later. You may want to do this to prevent endless loops. For example, when some code modifies the selectedIndex of a List, an event is fired. If you have a listener that reacts to the event, you may need a way of suppressing the listener’s response under certain conditions. You have two choices:

* Couple the listener to the code that generates the event, so it knows when to ignore the event. This defeats one of the purposes of event-driven programming, separation of concerns.
* Suppress the event dispatch

My gift to you today, dear reader, is the EventManager class. This class remembers all event listeners assigned to an EventDispatcher, and can remove or re-instate those listeners with a single method call.

package events {
import flash.events.EventDispatcher;

public class EventManager {
private var dispatcher:EventDispatcher;
private var type:String;
private var listener:Function;
private var useCapture:Boolean;
private var priority:int;
private var useWeakReference:Boolean;

public function EventManager(dispatcher:EventDispatcher, type:String, listener:Function, useCapture:Boolean, priority:int, useWeakReference:Boolean) {
this.dispatcher = dispatcher;
this.type = type;
this.listener = listener;
this.useCapture = useCapture;
this.priority = priority;
this.useWeakReference = useWeakReference;
}

private static function disableFn(item:*, index:int, array:Array):void {
var em:EventManager = EventManager(item);
em.dispatcher.removeEventListener(em.type, em.listener, em.useCapture);
}

public static function disableAll(listeners:Array):void {
listeners.forEach(disableFn);
}

private static function enableFn(item:*, index:int, array:Array):void {
var em:EventManager = EventManager(item);
em.dispatcher.addEventListener(em.type, em.listener, em.useCapture, em.priority, em.useWeakReference);
}

public static function enableAll(listeners:Array):void {
listeners.forEach(enableFn);
}
}
}

package {
public class EMDemo extends ComboBox {
private var listeners:Array = new Array();

override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void {
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
listeners.push(new EventManager(this, type, listener, useCapture, priority, useWeakReference));
}

/** Prevent update events from being issued */
public function quietlySetIndex(newIndex:int):void {
EventManager.disableAll(listeners);
selectedIndex = newIndex;
EventManager.enableAll(listeners);
}
}
}

Categories: Flex 3 Features

Updated Flex Builder for Linux Available on Adobe Labs

November 26, 2009 Leave a comment

The alpha 5 updated build of Flex Builder for Linux is now available on Adobe Labs.

Categories: Flex 3 Features

Data Visualization components with Flex SDK 3.3

March 12, 2009 Leave a comment

The new SDK 3.3 installation leverage features such as charts and the Advanced DataGrid. The library can be downloaded from the main Flex download page:

To install the library and related assets do the following:-

1. Unzip ‘datavisualization_for_SDK3.3.zip’ onto the SDK 3.3 folder (e.g. C:\Program Files\Flex Builder 3\sdks\3.3.0). This will extract the following into the SDK 3.3 installation
1. datavisualization.swc into the frameworks\libs folder
2. datavisualization__3.3.0.4852.swz and datavisualization__3.3.0.4852.swf into the frameworks\rsls folder
3. datavisualization_rb.swc into the appropriate frameworks\locale\ folder
4. DMV-source.jar into the lib folder
2. Open a command prompt or command shell and go to the ‘lib’ subdirectory in the SDK 3.3 directory tree e.g. C:\Program Files\Flex Builder 3\sdks\3.3.0\lib
3. Extract the sources for the data visualization components from DMV-source.jar by running the command ‘java –jar DMV-source.jar ../’ e.g. java –jar DMV-source.jar C:\Documents and Settings\All Users\Application Data\Adobe\Flex NOTE: the folder named ‘projects’ and the file ‘dmv_automation_build.xml’ will be extracted into the fbpro folder

Categories: Flex 3 Features

>Data Visualization components with Flex SDK 3.3

March 12, 2009 Leave a comment

>The new SDK 3.3 installation leverage features such as charts and the Advanced DataGrid. The library can be downloaded from the main Flex download page:

To install the library and related assets do the following:-

1. Unzip ‘datavisualization_for_SDK3.3.zip’ onto the SDK 3.3 folder (e.g. C:\Program Files\Flex Builder 3\sdks\3.3.0). This will extract the following into the SDK 3.3 installation
1. datavisualization.swc into the frameworks\libs folder
2. datavisualization__3.3.0.4852.swz and datavisualization__3.3.0.4852.swf into the frameworks\rsls folder
3. datavisualization_rb.swc into the appropriate frameworks\locale\ folder
4. DMV-source.jar into the lib folder
2. Open a command prompt or command shell and go to the ‘lib’ subdirectory in the SDK 3.3 directory tree e.g. C:\Program Files\Flex Builder 3\sdks\3.3.0\lib
3. Extract the sources for the data visualization components from DMV-source.jar by running the command ‘java –jar DMV-source.jar ../’ e.g. java –jar DMV-source.jar C:\Documents and Settings\All Users\Application Data\Adobe\Flex NOTE: the folder named ‘projects’ and the file ‘dmv_automation_build.xml’ will be extracted into the fbpro folder

Categories: Flex 3 Features

IP Validator Component.

February 9, 2009 Leave a comment

package
{
import mx.validators.ValidationResult;
import mx.validators.Validator;

//Class should extend mx.validators.Validator
public class IPAddressValidator extends Validator {

public function IPAddressValidator() {
// Call base class constructor.
super();
}

// Class should override the doValidation() method.
// doValidation method should accept an Object type parameter
override protected function doValidation(value:Object):Array {
// create an array to return.
var ValidatorResults:Array = new Array();
// Call base class doValidation().

ValidatorResults = super.doValidation(value);
// Return if there are errors.

if (ValidatorResults.length > 0)
return ValidatorResults;

if (String(value).length == 0)
return ValidatorResults;

var RegPattern:RegExp = /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/;

var a:Array = RegPattern.exec(String(value));

if (a == null){
ValidatorResults.push(new ValidationResult(true, null, “IPAddress Error”,”You must enter an IP Address”));
return ValidatorResults;
}
return ValidatorResults;
}
}
}

Categories: Flex 3 Features

>IP Validator Component.

February 9, 2009 Leave a comment

>package
{
import mx.validators.ValidationResult;
import mx.validators.Validator;

//Class should extend mx.validators.Validator
public class IPAddressValidator extends Validator {

public function IPAddressValidator() {
// Call base class constructor.
super();
}

// Class should override the doValidation() method.
// doValidation method should accept an Object type parameter
override protected function doValidation(value:Object):Array {
// create an array to return.
var ValidatorResults:Array = new Array();
// Call base class doValidation().

ValidatorResults = super.doValidation(value);
// Return if there are errors.

if (ValidatorResults.length > 0)
return ValidatorResults;

if (String(value).length == 0)
return ValidatorResults;

var RegPattern:RegExp = /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/;

var a:Array = RegPattern.exec(String(value));

if (a == null){
ValidatorResults.push(new ValidationResult(true, null, “IPAddress Error”,”You must enter an IP Address”));
return ValidatorResults;
}
return ValidatorResults;
}
}
}

Categories: Flex 3 Features

IP Validator Component.

February 9, 2009 Leave a comment

package
{
import mx.validators.ValidationResult;
import mx.validators.Validator;

//Class should extend mx.validators.Validator
public class IPAddressValidator extends Validator {

public function IPAddressValidator() {
// Call base class constructor.
super();
}

// Class should override the doValidation() method.
// doValidation method should accept an Object type parameter
override protected function doValidation(value:Object):Array {
// create an array to return.
var ValidatorResults:Array = new Array();
// Call base class doValidation().

ValidatorResults = super.doValidation(value);
// Return if there are errors.

if (ValidatorResults.length > 0)
return ValidatorResults;

if (String(value).length == 0)
return ValidatorResults;

var RegPattern:RegExp = /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/;

var a:Array = RegPattern.exec(String(value));

if (a == null){
ValidatorResults.push(new ValidationResult(true, null, “IPAddress Error”,”You must enter an IP Address”));
return ValidatorResults;
}
return ValidatorResults;
}
}
}

Categories: Flex 3 Features

mx_internal

December 14, 2008 Leave a comment

mx_internal is a namespace used by the Flex framework to partition out functions and properties that may change in future releases of the Flex SDK.

You can access properties and functions in this namespace as shown below:

Categories: Flex 3 Features

mx_internal

December 14, 2008 Leave a comment

mx_internal is a namespace used by the Flex framework to partition out functions and properties that may change in future releases of the Flex SDK.

You can access properties and functions in this namespace as shown below:

Categories: Flex 3 Features
Follow

Get every new post delivered to your Inbox.