Notes on Java, Solaris, PHP, LDAP…

November 17, 2007

Adobe Flex and MXML

Filed under: Uncategorized — negev @ 8:46 pm

Flex public variables in Action Script act as ‘global’ variables – potential for spaghetti code

Popup windows in Flex

Flex 2 Metadata Tags[Bindable] etc

Non-visual components in Flex – in Action Script or MXML:
“If all they need is a container for nonvisual components that is
itself a nonvisual component, then just create one that extends
IMXMLObject that accepts any other IMXLObjects as children.

But really, I would recomend doing as much as possible in AS anyway.
AS is going to compile faster so your build times will be shorter. AS
code is easier to debug. And expanding ActionScript skills will only
help you be a better flex developer.”

Polarion – SVN plugin for IDE

26 Apr 07
–ignore-blank-lines –side-by-side –left-column –minimal –width=180

Flex custom centered/positioned renderer
– we want a custom ‘dynamic’ renderer, which shows a picture that depends on data row
– we want it to be horizontally centered
— we cannot center it by padding because it’s used in a DataGrid where width of columns can be resized
— we cannot set alignment in CSS – see
– following uses embedded images; or uncomment the image names and remove the embedded variables
– don’t use override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void in mx:Image because it’s invoked too frequently – every time you move a mouse over the Data Grid.

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Box xmlns:mx=”; direction=”horizontal” horizontalAlign=”center” verticalAlign=”middle” >
<!– By some good magic of Flex he ‘source’ handler in the following mx:Image gets ‘data’ parameter.
However, the actual renderer object is the outer mx:Box and this mx:Image is only a component of it.
<mx:Image id=”image” source=”{getSourceName(data)}” >
private var admin_star :Class;
private var admin_blank :Class;

private function getSourceName(data: Object): Object {
if( data.is_admin ) {
return admin_star; //”resources/admin.gif”;
return admin_blank; //”resources/not-admin.gif”;

Double-click handling in Flex:
<!– If we handle double clicks for data grid, which would display detailed info on user
– same as selecting a user and pressing an info button –
then we can’t handle both single clicks and double clicks. If we have handlers for both
then double click handler is ignored.
doubleClick=”‘double click’)” doubleClickEnabled=”true”
==> set doubleClickEnabled

CSS properties supported by Flex:
The actual set depends on current Theme –
List of supported properties – from

  • color
  • fontFamily
  • fontSize
  • fontStyle
  • fontWeight
  • paddingBottom
  • paddingLeft
  • paddingRight
  • paddingTop
  • textAlign
  • textDecoration
  • textIndent

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: