Showing posts with label Flex. Show all posts
Showing posts with label Flex. Show all posts

Saturday, October 8, 2016

Converting key / value text files to JSON

I'm currently working on the conversion of a huge Flex application to Angular 2. 
Flex uses text files containing key/value pairs for localization (i18n). 
In order to convert those to JSON, I've created a simple automating tool which allows dropping multiple text files and automatically converts the data to JSON.

I've made this tool available online with some useful properties to control the JSON output structure. Feel free to give it a try:

https://amirch1.github.io/blog/text2json/


Monday, August 29, 2011

Extending MXML Components with MXML

I've recently needed to create an MXML component that enables users to add MXML
content into it. The solution is simple yet powerful and provides a way to easily create
extendable MXML components.
In the example below, the component holds a ButtonBar and a ViewStack.
The ViewStack itself is a property of the component that can be added in MXML
when using the component. Each user can add as many views as he needs and
the ButtonBar displays the views.


Code can be found here.

Monday, July 18, 2011

Enabling / Disabling drop menu items dynamically

Recently, I had to find a way to enable or disable drop down menu items according
to the current view. While searching for an elegant solution, I've stumbled across a
piece of code that changed my approach all together. It seems that you can add data
binding into the XML data itself. While Flex compiles the file, it parses the XML data and
assigns the correct data binding.
Take a look at the example below:


Code can be found here.

Wednesday, February 9, 2011

AutoScroll Canvas Component

Recently, I had to come up with a generic component that can scroll anything within it, according
to the mouse location.

This component extends Canvas and has a "Speed" property and a "ScrollToPosition" method.
Check out the example below. Source can be downloaded here.





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...

Wednesday, June 2, 2010

Background Tiles & Object Handles

In one of my recent projects, I had to build a tiles background for a resizeable window and an element that the user can move and resize.
For the tiles background I used the excellent CanvasBackground.
For the elements I used Object Handles which reside on Google code.
Here you can find a little sample combining both features. Source code is here.


If you wish to see my implementation - here is a link to a part of the application I'm working on.

Monday, May 31, 2010

4 Matrices graph

 chartOur creative product managers had an idea to produce a graph which enables viewing up to 4 simultaneous matrices. 
Since our web team fled to their lunch break (I guess they saw it coming...), they came to visit me. 
This visit resulted in the following mock-up:



OK, I know Google Analytics are doing a better job, but still - I think the result is rather cool.

Play with it (not all the features are fully working). Let me know what you think...



Sorry, but the source code can not be released right now as it belongs to the company I work for.
If you have any questions, my E-mail is always open...




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