BetaDesigns( Blog ) Flex and Component Development

10Jul/100

Converting MX Component to Spark Component ( Part 2 – a )

In the previous post we began building our custom Spark colorPicker by creating the preview class and it's corresponding default skin.
In this post we will begin by creating a KeyboardManager class that will allow us to calculate the new index in the dataProvider after a Up/Down/Left/Right keyboard input.

This class can become quite complicated because we want the following behaviour from our keyboard manager.
The selected index should be able to move up past the top of the dataProvider and move to the bottom row and vice versa, in addition we should be able to go off the left hand side of the columns and appear on the right hand side and vice versa.

For example if the dataProvider has 25 items and each row contains 5 columns.

Up / Down Examples.
If we are at column 1 row 1 ( box 1 ) and we press up we should go to column 1 row 5( box 2 ) and then for every key press we should move up the column until we hit the row 1 column 1 index again. However if we press down then we should go to column 1 row 2 and so forth until we hit column 1 row 5 ( box 2 ). Then when we press down again we should move to the top of the column again row 1 column 1 ( box 1 ) and this should be the case for each column no matter how many rows it has.

Box 1          Box 2
Box oneBox two

6May/104

Custom FlashBuilder Component Views

I recently discovered that you can create custom components that can appear under your own company/personal folder inside Flash/Flexbuilder design view. Normally any custom component you create will appear under the Custom folder in the Components View and well thats not very good for branding now is it. In addition you also get an actual size representation of your component in Design view rather than just an empty box outline. For example the first image is the default and the second the custom.

29Apr/102

FlexUnit4 & Parsley

For the last six months I have been working on a rather large enterprise application that uses parsley as it's main Dependency Injection Framework. This has led to many complex class' that contain multiple injected models, VO and other elements. Recreating these items inside test harness can become very cumbersome if you have to create a large injection heirarchy. Consider the following example.

16Oct/091

Binary Clock

I have been looking into bits, bytes and bit shifting a lot recently so I thought I would quickly make a small binary clock to help burn it into my mind. In addition it also gave me the chance to experiment with the spark skinning. Below is the result. Not pretty I know but thats what the skinning is for.

Get Adobe Flash player

Full source

18Aug/090

IMXMLObject for non visual components

I have been using Flex for a couple of years now and i still find new and interesting framework items. In comes IMXMLObject. Up until recently whenever i wanted to place a non visual component into mxml i was extending UIComponent to allow me to place these items in MXML, however among other things this meant that they would be included in the layout and come with a high footprint.
The solution seems to be to implement the IMXMLObject interface this will allow you to place non visual components into your mxml code without having to worry about layout or an unnecessary memory footprint.

usefull links
livedocs
smashedapples
techper

29Apr/092

AVM1Movie Controller in Flex

I just wanted everyone to know about this awesome class i found. I needed to load some Flash 8 movies into my flex application and control the play head dependent on labels inside the flash movie.

This was proving really hard until i found that class now it is a piece of cake!
Thanks whoever you are maruthi2000

12Mar/091

Flex Cookbook Recipe 5.8 Allow Certain items in a list to be selectable, Doesn’t quite work correctly

Ok I needed to disable Heading elements inside a List Component in Flex, and i was being too lazy to work it out for myself so i picked up the Flex cookbook Adobe had been kind enough to send me and yes... It was there. Now the Mouse removal was straight forward and worked like a charm. But the keyboard events were a different story. The code didn't work for several reasons.
1. Key directions were not being assigned.
2. When a disabled item was at either the top or the bottom of the list it would stop you being able to continue down / up the list.
To fix this i added the following code.

5Jan/090

System.vmVersion

A fellow Senior Rich Internet Applications Developer at work Sam found a nice new undocumented attribute in the Systems package today. vmVersion seems to return the current Flash player virtual machine running on your computer. Mine, and Sams for that matter traces out as 1.0 cyclone. Not sure how useful this is but interesting none the less.