BetaDesigns( Blog ) Flex and Component Development

10Mar/110

First Blackberry Playbook Application

Blackberry Playbook

Just wrapping up my first Blackberry Playbook Application ready for the now extended Free Blackberry Playbook offer. I must say that I have found it extremely easy to developer for. Apart from the Camera Api's not working I have been able to create a version of an iOS application i have been working on in less than a week! ( it has taken me months to write the iOS version and it is still not finished! ).

Once I get my app approved I will do a more detailed post on how i created it.

Details Coming soon.

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

10Jun/103

Converting a MX component to a Spark Component.

In this brief set of posts I wanted to document how to convert a simple MX component over to a Spark component. I have chosen to convert the MX ColorPicker because it is one of the components that Adobe hasn't moved over to the Spark framework yet as well as being the component that I used to learn the Flex3 Framework. You can see the outcome and view the source of that in my previous posts from a couple of years ago here and here

Below you can see the three components.

The Spark component does all the stuff the old MX one does like keyboard movement, selectedIndex, selectedColor, colorLabel, etc.. In addition I also added the ability to set/get the selectedItem and dispatching indexChange events.

To begin with lets look at what the current color picker does.

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.

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.

[kml_flashembed publishmethod="static" fversion="10.0.0" movie="http://www.betadesigns.co.uk/Examples/BinaryClock/TestProject.swf" width="169" height="92" targetclass="flashmovie"]

Get Adobe Flash player

Full source

28Sep/090

Forcing the Browser to crash using ActionScript

I just discovered this little trick, I'm not sure how useful it is but it works.

Simply create a class that throws an error in the constructor. This will cause the browser to crash and close.

 
 
package
{
   public class BrowserCrasher
   {
      public function BrowserCrasher( )
      {
         throw new Error( 'goodbye browser' );
      }
   }
}
 
Filed under: ActionScript, Flex No Comments
28Sep/090

Enums and static initializers in AS3

I just came across the idea of static initializers in Java and was wondering if they are available in ActionScript as well.

I found a couple posts on the subject.

post 1

post 2

16Jul/090

Layout Organizers

I recently stumbled across this awesome project by somerandomdude and just wanted to give it some exposure as it is open source and even in 3D

18Mar/091

Unable to Catch IOErrorEvent’s when Loading a ByteArray into an Image

I was trying to load a byteArray into an image control today and would randomly get an Unhandled IOErrorEvent message. Now this shouldn't really happen as the image control uses a default broken image icon to display when there are any loading problems. Well after trying to catch the error unsuccessfully I wanted to know what was going on.
So i went digging and i found in the base class of image, SWFLoader line 1497 the following