Wednesday, January 26, 2011

Filtering out Chart columns from a DataGrid

Many times we use a combination of Grid and Chart to display the same data and we use the
same data provider for both. The problem starts when you want to filter out some data from the
chart (for example) but not filter it out in the grid.
If you use the same data provider and a filter function, the data will be filtered out in both. 

A colleague from work offered a solution to use XML filtering for this task.
I've implemented this idea using an XML based data provider and ActionScript XML filtering 
to filter out data from the chart only.
Take a look at the example below: you can filter out chart columns using the check boxes in 

the grid.
Code can be found here.




Sunday, January 9, 2011

Accessing the Timeline of a loaded SWF in AS3

While Flex provides you with a designated component for loading and communicating with external SWF files,
when you work in Flash - you are not that lucky.
In AS2, you could load an external SWF into a MovieClip and then target it using that MovieClip instance.
In AS3 however, things are not that easy: External SWF files are loaded using the Loader Class,
and in order to get access to their timeline - you must get a reference to that loader's contentLoaderInfo property.

Take a look at this example:




You can download the source here.

Wednesday, November 10, 2010

Changing the Z-Order of ObjectHandles in Flash Builder 4

I've been working with ObjectHandles in few Flex projects but this is the first time I've implemented
it in a Flex 4 based project. Changing the Z-Order of the ObjectHandles is a bit different here,
since Flex 4 uses the IVisualElement object to control the index of each element in a container.

Below is a sample that allows moving objects backwards and forwards either one step
at a time or all the way.



Source code can be found
here.

Thursday, August 26, 2010

Dynamically adding MXML components to the application

A few days ago, a question regarding MXML components was raised at the Flashoo forum.
The question was how can we add an MXML component defined in the project, at runtime, 
by its name. The name is build dynamically as well. When I tried to do so - I found that it is a 
bit more complex than it looks. The reason is that the Flex Linker and Compiler do not include
such components in the output SWF since there is no reference to them in the code.
The solution is to include a reference variable for each component, even though it is not really
used. Check out this little example. You can find the source code here.


Wednesday, June 9, 2010

Free Flash Builder 4 from Adobe!

Adobe is giving away free licenses for Flash Builder 4!
If you are a student or unemployed (or maybe both...) you can sign to get your free license.

Sunday, June 6, 2010

FilterFunction in ArrayCollection

Each time I have to implement an array filter, I find myself deeply impressed with the Flex ArrayCollection Filterfunction feature. 
If only they had it in Flash... If you are not familiar with it - here goes: 
FilterFunction is an ArrayCollection property allowing the definition of filter conditions for the data.
The function receive each object from the array and decide if it should be filtered out or not.
The result is returned as a boolean value.
Since this function can combine as many validation terms as we wish, it can easily implement multiple filters.
Here is a little sample. Just type inside the Filter field: 




I used "toLowerCase" in order to disable the case sensitivity. 
Also, the function looks for the input text anywhere in each listed country (not only at the beginning). 
And yes, I know not all the countries are listed...
Source code is here.

Thursday, June 3, 2010

Great website for designers/developers freebies!

I like this website...
Lots of freebies for designers (icons, templates etc.) and developers (Flash/Flex open source).
For your consideration...

About Me

My photo
I've been developing Internet and rich-media application for 15 years. In my work I emphasis usability and best user experience as well as sleek design. My main expertise are JavaScript, Flex and Flash.

Followers