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.

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