Written by

I have stumbled across an old fix I found for a problem I had with an mx:ComboBox ages ago and thought it worth while blogging about. Basically I found that if I bound an ArrayCollection to the dataprovider of a ComboBox and then changed the contents of the ArrayCollection, the ComboBox would not update? I tried all sorts of things i.e. itemUpdated() on the provider/collection, invalidateProperies/DisplayList on the ComboBox and so on to no avail. I originally found that setting the prompt attribute in the ComboBox caused the issue but on building a quick example application I found that with or without the prompt it still fails to update. In fact its even odder without a prompt, the selected item changes but not the content within the dropdown???

Read on →

Written by

I have used the below logic repeatedly now for processing Flash Vars in my Flex 4 applications which others may find useful. In the example below I use it in a service class. Basically I define a custom value object with the flash var properties defined. I then loop through the available parameters in the loadParameters() method using a [Transient] array which returns the name of each parameter.

Read on →

Written by

I have been working on some further ANT scripts recently on my Ant-Funk repository that tests out integrating Github logic. Thanks to an old friend Mark Lowe who helped put together an nice git-task ANT script I have managed to run the core common Github related tasks i.e. initialise a directory, add, checkout, commit, push, remote add and check current revision in a local repository.

Git-task ANT Scripts

Git-task ANT Tests

I have written some test scripts that all work fine, running the ANTUnit build file works a treat, however, it’s kinda cheating as I am yet to fully add assertions to some of the tests. Due to lack of time I basically just wanted to get some simple scripts to test each bit of functionality individually to ensure it all works. I have been struggling to come to a definitive decision on how to pass/fail some of the tests due to committing to remote repositories etc, if anyone has some suggestions I would be appreciative, I am not sure if revision checking (on a push) is the best logic?

It’s been a tricky one getting some further understanding of how Github works and why some of my tests just would not work. For example, I was initialising a directory then clone/pulling into it which would fail, doh! This was because when you clone/pull the project folder is created and initialised, obvious really….

I will post up an actual example of how to use them in a project as I am yet to do this myself. I hope they are helpful for someone out there.

P.S. Props again to Mark Lowe for your help on this and also the blog post he got some source code from (and I used the revision comment by Timo).

Written by

I use an ergonomic mouse (Evoluent VerticalMouse) which doesn’t function to it’s full potential on Mac OSX. I then discovered a USB driver called SteerMouse which recognises my mouse fine but comes with some extra functionality which proved to be both useful and time saviing (an alternative driver company is USBOverdrive).

In a nutshell there are configurable commands that can be triggered by any button on your mouse:

Read on →

Written by

Dan aka PolyGeek has reminded me that I have been meaning to write a short post about using a darker theme in Flash Builder. In IntelliJ IDEA I use the fantastic Dark Pastels theme by Ted Wise but for Flash Builder a.k.a Eclipse I could not find a similar theme (ok thats a lie, I found some dark themes but it wasn’t to my liking). So I decided to tackle the arduous task of going through all the preferences and setting the fonts and colours manually.

Initially I exported my preferences to an .epf file but Eclipse was temperamental on how it would import these settings and I could not get a consistent result. I then found this post and then dived into the workspace for Flash Builder and if you have the standalone version your in for a treat as it only really shows ActionScript and MXML related preferences so you don’t have to dive through a mine field of different language preferences.

I have uploaded my preferences which result in an IDE looking like the below screen shots, may not be to your taste but its a start to get fiddling. NOTE that I have stripped out certain settings not really applicable so please don’t overwrite your existing files as you will lose your existing settings. I imported these as they are directly into a new workspace and it worked fine for me though.

Read on →

Written by

Here is a quick and easy way to detect a users Flash Player Version using SWFObject:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!-- SWFObject js files -->
<script type="text/javascript" src="js/swfobject.js"></script>
      
<script type="text/javascript">

  var minMajorVersion = 9;
          
  var flashVersion = swfobject.getFlashPlayerVersion();
          
  if(flashVersion['major'] >= minMajorVersion){
          alert("Flash Player Version correct");
  }
          
</script>

Written by

Cliff Hall from Future Scale and PureMVC has released a public Beta for his companies new product called Zarqon. This is a much needed AIR app for licensing your Flex/AIR applications and the beauty of it is that its reliant only on Amazon S3 no other third party dependencies!

Zarqon is a cloud-based system that works with Adobe Flex and AIR to give you feature-level control of your software, and complete ownership of your license-holder data, which is stored and accessed for pennies per month in your own Amazon S3 account. Sell your application anywhere and anyhow you like. Your data never passes through our servers and you pay no royalties or percentages on the licenses you sell aside from your payment vendor’s charges.

There is not much point in me running through what Zarqon does as Cliff has documented it thoroughly on the links above, so go visit the Zarqon home page have a good read around this cool piece of software he has developed. If your interested in registering as a Beta tester though (for the moment at least) you have to be in the US to join the beta program.

Read how to secure your Flex application with Zarqon. Read how to secure your AIR application with Zarqon.

Written by

I have created a small file template for creating custom Event classes quickly and easily using IntelliJ IDEA. Simply go to Preferences > [IDE Settings] File Templates > Create a new template [click the + icon] > Name it i.e. ActionScript Event | Give it an extension i.e. as | enter the below script and your sorted. Now if you right click on your project and select New > ActionScript Event you can enter the couple of defined params and your done and dusted.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package ${PACKAGE_NAME}#if (${PACKAGE_NAME} != "") #end{

import flash.events.Event;

public class ${NAME} extends Event {
    
    public static const ${CONST}:String = '${CONST}';
    #if (${eventObject} != "")
    public var ${eventObject}:${eventObjectClass};#end
    
    public function ${NAME}( type:String, 
                             #if (${eventObject} != "")
                             ${eventObject}:${eventObjectClass},#end   
                             bubbles:Boolean = false, 
                             cancelable:Boolean = false ) {
        super( type, bubbles, cancelable );
        #if (${eventObject} != "") this.${eventObject} = ${eventObject};#end 
    } 
    
    override public function clone():Event{
          return new ${NAME}( type,#if (${eventObject} != "") ${eventObject},#end bubbles, cancelable );
      }
}
}

Written by

I found this post unfinished in my drafts folder and I have no time to go into detail explaining the script as I previously would have liked, however, I have released the source and listed below are all the relevent aspects of the ANT build and classes. Looking at the source quickly to refresh my mind there are some useful elements there for (a) compiling modules, swf’s and swcs using ANT (b) module loading in PMVC using an external xml file (c) compiling and using all library resources into one library swc (whether good or bad).

At the tail end of 2009 I built an script for ANT which compiled a flex modular project and I wanted to build a demo around this script. Due to lack of time it’s taken a lot longer than I had hoped to wrap this up and to be honest I am sure there are areas that could be further refined. Essentially my main goals are achieved with this example, one of which being all the module swf’s are external projects in relation to the main application project.

Once again to save time I have not totally re-invented the wheel and have basically expanded Joel Hooks excellent application he uses in his blog post on the same topic, thanks for your approval for this Joel.

Read on →

Written by

In my previous post I mentioned using BindingUtils to update a View with data from a Model. One problem I found were my bindings within nested properties i.e. accessing a value within an Object in a Class, were not firing. The sequence would be model.data.selectedValue.value and setting up the binding in ActionScript I had used incorrectly:

1
2
// Incorrect
BindingUtils.bindProperty( view.my_txt, "text", model.data.selectedValue, "value" );

The correct way to approach this is to actually set a chain of bindable properties as String values within an Array.

A non-empty Array containing a combination of the first two options that represents a chain of bindable properties accessible from the host. For example, to bind the property host.a.b.c, call the method as: bindProperty(host, [“a”,”b”,”c”], …).

So the above correctly written would become:

1
2
// Correct
BindingUtils.bindProperty( view.my_txt, "text", model, ["data", "selectedValue", "value"] );

A small oversight that could easily be made.