Saturday, June 20, 2009

Flex Drag-and-Drop: The Definitive Tutorial

Flex After Dark has just published a new (our first) tutorial on how to Drag-and-Drop in Flex.

Drag-and-drop
lets you move components and transfer data in a Flex application via the mouse and ubiquitous "click-drag-drop" paradigm. All Flex components support drag-and-drop operations with the proper enablement.

We're going to follow these steps to learn about Drag-and-Drop in Flex:

  1. Create a Project and Application
  2. Create some Boxes (one for dragging, one for dropping)
  3. Make the Red Box Draggable
  4. Make the Blue Box a Drop Target
  5. Handle the Drop
  6. Show Feedback
  7. Use Drag Source
Click here to learn how to Drag-and-Drop in Flex at Flex After Dark...

Thursday, June 11, 2009

Updated Documentation

The following documentation has been updated...

Google Maps API for Flex/Flash

The Google Maps API for Flash lets Flex developers embed Google Maps in Flash applications. Similar to the JavaScript version, this ActionScript API provides a number of utilities for manipulating and adding content to maps through a variety of services, enabling you to embed robust, interactive maps applications on your website.

Tuesday, June 9, 2009

Saturday, May 30, 2009

Saturday, April 4, 2009

Free Flex Builder for Unemployed Developers

Adobe Flex Builder 3 software is currently available for free for software developers who are affected by the current economic condition and are currently unemployed.

To receive the product under this program, you must attest to the fact that you are currently unemployed and that the software will be used only for your personal use not for any production or commercial purposes

https://freeriatools.adobe.com/learnflex/

Sunday, March 29, 2009

ActionScript Language Overview

ActionScript is a powerful, object-oriented scripting language. The latest/current version of ActionScript is version 3.0.

ActionScript and MXML are the languages of Flex. ActionScript code is defined in files with the .as extension or in within elements of .mxml files.

Learn more about ActionScript 3.0 at Flex After Dark...

ActionScript 3 Top-Level Data Types:

  • Array - The Array class lets you access and manipulate arrays.
  • Boolean - A Boolean object is a data type that can have one of two values, either true or false, used for logical operations.
  • Class - A Class object is created for each class definition in a program.
  • Date - The Date class represents date and time information.
  • Error - The Error class contains information about an error that occurred in a script.
  • Function - A function is the basic unit of code that can be invoked in ActionScript.
  • int - The int class lets you work with the data type representing a 32-bit signed integer.
  • Number - A data type representing an IEEE-754 double-precision floating-point number.
  • RegExp - The RegExp class lets you work with regular expressions, which are patterns that you can use to perform searches in strings and to replace text in strings.
  • String - The String class is a data type that represents a string of characters.
  • uint - The uint class provides methods for working with a data type representing a 32-bit unsigned integer.
  • XML - The XML class contains methods and properties for working with XML objects.
  • XMLList - The XMLList class contains methods for working with one or more XML elements.
  • (some have been omitted, see http://livedocs.adobe.com/flex/3/langref/package-detail.html for more)

Saturday, March 21, 2009

Search Functionality

I've spent some time this weekend adding search functionality to Flex After Dark. To do this I'm using Whoosh, an excellent full-text indexing and searching library implemented in Python.

I plan on writing quite a bit more about the technology behind Flex After Dark as the site continues to be developed. So stay tuned for future posts about Python and Django.

Thursday, March 19, 2009

Flex and JavaScript Integration

Use the ExternalInterface class for ActionScript-JavaScript communication.

ExternalInterface defines two especially important static functions:

  • call( functionName:String, ... arguments ) - call a container function
  • addCallback( functionName:String, closure:Function ) - expose a Flex function to the container

Calling JavaScript from ActionScript is easy with ExternalInterface . Simply call the static call() function passing the function name and, optionally, any arguments.

   // call a JavaScript function defined in the container page
var result:String =
ExternalInterface.call( "doSomethingInJavaScript", arg1, arg2 );

Learn more about calling JavaScript from ActionScript with ExternalInterface at Flex After Dark...

Monday, March 16, 2009

ActionScript 3 vs. Java

Both Java and ActionScript...

  • Are object oriented
  • Use single inheritance
  • Have a base Object class (which is automatically sub-classed)
  • Use strongly typed variables
  • Have Packages, Classes, and Interfaces
  • Support public, protected, and private methods and variables
  • Support static functions and variables
  • Support try/catch/finally exception handling
Of course there are many differences between Java and ActionScript.

Read more about ActionScript vs. Java at Flex After Dark...

Saturday, March 14, 2009

Responders in Flex

A Responder is simple class encapsulating the handling of a Remote (asynchronous) call and its result and/or fault. A Responder class implements the IResponder interface in the mx.rpc package.

A Responder object has two key methods:

  • result() - function receives a ResultEvent
  • fault() - function receives a FaultEvent

Read more about asynchronous Responders in Flex at Flex After Dark...

Thursday, March 12, 2009

Binding in Flex

Flex Data Binding enables objects and their values to be bound together so that when a source changes a target automatically gets updated.

Data binding players:
  • Source - the object/value we are interested in observing
  • Target - the object/value we going to copy the source value to
  • Trigger - the event from the source that triggers the copy from source to target

Learning more about Binding in Flex at Flex After Dark...

Wednesday, March 11, 2009

ActionScript Arrays

Arrays a common data structure in nearly any programming language, including ActionScript.

Characteristics of Arrays in ActionScript:

  • Arrays hold references to other objects, including null
  • Arrays are 0-based (like Java, unlike ColdFusion, for instance)
  • Arrays are unbounded meaning one will automatically grow as items are added
Find about more about Flex and ActionScript Arrays at Flex After Dark...

Thursday, February 26, 2009