Sunday, April 29, 2007

Flex 2.0.1 ComboBox with icon support.

Sometimes a ComboBox with icons in the list as well as in the text display area can be useful. However the out of the box Flex ComboBox component dosn’t support this. Here is one way of doing it.


Jason Hawryluk made good component. you can get here

Thursday, April 26, 2007

eval API for Flex™ 2

The D.eval() (read DEE-val) API is a SWC library for Flex™ 2 applications to execute text strings of dynamic ActionScript expressions and programs. The language used in D.eval() is Deval, a subset of the ActionScript 3 (AS3). It supports all the AS3 expressions (including E4X) and most flow control statements; it can access any AS3 classes and functions; it does not define functions and classes. D.eval() opens a whole new world to Flex™ 2 applications and application development.

download here

Create Custom ContextMenu

The following example hides all the built-in objects in the Context menu. (However, the Settings and About items still appear, because they cannot be disabled.)

var newMenu:ContextMenu = new ContextMenu();
newMenu.hideBuiltInItems();
this.menu = newMenu;

In this example, the specified event handler, menuHandler, enables or disables a custom menu item (using the ContextMenu.customItems array) based on the value of a Boolean variable named showItem. If false, the custom menu item is disabled; otherwise, it's enabled.

var showItem = true; // Change this to false to remove
var my_cm:ContextMenu = new ContextMenu(menuHandler);
my_cm.customItems.push(new ContextMenuItem("Hello", itemHandler));
function menuHandler(obj, menuObj) {
if (showItem == false) {
menuObj.customItems[0].enabled = false;
} else {
menuObj.customItems[0].enabled = true;
}
}
function itemHandler(obj, item) {
//...put code here...
trace("selected!");
}
this.menu = my_cm;

When the user right-clicks or Control-clicks the Stage, the custom menu is displayed.

Wednesday, April 25, 2007

Artemis

Artemis is a community focused project aimed at bringing external libraries
to the Flex / Flash environment. The goal of Artemis is to provide features in the
Flex / Flash desktop application domain that are not currently available. The Artemis
framework allows a developer to create their own custom libraries (currently written
in java with plans to support other languages) that integrate with a Flex / Flash
Apollo application. Developers will be encouraged to share Artemis libraries they’ve
built and discuss new features through this web site.



For Flex Developers:

Artemis provides a way for developers to collaborate on building extension to
theApollo framework. Nearly any java API can be encapsulated in an Artemis Library and
exposed to an Apollo application through the Artemis framework.



The Java Artemis Bridge developers have the capability of interfacing with
hardware on Bluetooth and other communication ports, are able to off load expensive
tasks like XSLT to the java process, and in the end let Flex do what Flex does
best: present an engaging and interactive user interface. No more hang ups in having
the Flash player fight for processing resource, an Artemis developer can tap into a
multi-threaded environment provided using java.