I have had some requests and seen some developers asking about managing a ViewStack using the PureMVC StateMachine utility. Slacker is a well known demo detailing how to manage View components using deferred instantiation. Combining this demo and the StateMachine utility is a straight forward route to managing a ViewStack in your PureMVC application. I have knocked up a demo which demonstrates how to achieve this.

Read on →

Due to my eldest daughter (a) having proper homework which involves more than 10 minutes work (b) having a laptop, I have now decided to set up my Canon IP3000 printer on the network. I use a DrayTek Vigor 2800G router which has a USB printer port and presumed the set up on Mac OS X would be straight forward. I found a couple of obstacles and loads of confusing documentation online advising LPR on the Mac OS X with Canon printers and some conflicts on drivers required.

DrayTek provide the following link which proves from their end its super easy (which it was). The problem arose when it came to selecting the Canon IP3000 driver in the Print Using: dialogue, because it didn’t display the correct driver. So I went to the Canon site and downloaded the latest driver, restarted the computer and still it wouldn’t show. Then I found online some options, one involved CUPS, the second unfortunately cost $ and lastly I found Gutenprint!

Gutenprint provide a super simple installation process, no restart required and immediately the driver showed up when I started the Printer IP setup process! Job done….

My buddy Steve asked me for a skeleton PureMVC example application, something very basic to get your head around the work flow. I thought I may as well upload it for all as it may be of use to someone else out there. It really is a super simple example Flex application with a View component and Mediator containing a DataGrid thats populated by an ArrayCollection in a Proxy. It uses the Multicore version of PureMVC and also demonstrates how to send a simple notification through the framework when a button is clicked.

source

Once you have got to grips with the basics then I would suggest learning about managing states using PureMVC by reading this article I wrote: http://www.newtriks.com/?p=363. Be sure to also read up on my suggestion on how to handle Popups http://www.newtriks.com/?p=329.

For hardcore heads who want to now move onto modular development please see this post!

I have had some problems with my mac pro recently and also got myself a new mac book and to cut a long story short I have had to reformat/reinstall quite a few times. I had a small list of core installs/setup processes which I follow each time to get Eclipse, Flex, ColdFusion 8, PHP and MySQL up and running.

I have 2 drives in my mac pro and favour using one as a boot drive and the other for my Users directory which I then setup to be backed up on my NAS (using TimeMachine) and on Amazon S3 (using JungleDisk). Everytime that I have had Leopard problems this setup proves perfect as I simply remap my Users directory and bam! all back as it was for my documents and projects.

There are 2 pieces of software that I find invaluable for working of multiple computers (one of which thanks to Stef) (1) 1Password and (2) DropBox. Using 1Password you can pop its agilekeychain into DropBox and therefore sync all logins across all computers you have both pieces of software installed. Its little time savers like this that prove invaluable.

Here is my small setup routine list with links (may update as time goes on and would be interested in hearing other peoples additions):

Read on →

All that hard work has some sweet perks and one came through my inbox yesterday. An invitation to become an Adobe Community Expert!!! Thanks to Adobe for the invite and thanks to Stef!

I have since re-structured some of my logic in handling popups in a Flex application using PureMVC. If you refer to my previous post you will see that I have a PopManager that extends PopUpManager and the core logic to handle opening and closing Popups was via the Mediator. I have now ripped this logic out so it is handled by a Command and popups can now be opened/closed via a notification, cleaner, simpler and more logical to PureMVC.

Read on →

UPDATE registerClassAlias() see below!

This is tripping me out now. On our current project all responses from a remoting call to ColdFusion return custom Value Objects maintaining their data type fine, however, nested VO’s do not maintain their data type and are returned as plain ol’ Objects???

To over come this we create an instance of the vo in the class handling the remoting response which does fix this problem but I am not keen on having to do this i.e.

Read on →

Navigate to the Eclipse/Flex installation directory, right click the .app to show package contents and then navigate to either the eclipse or FlexBuilder in Contents/MacOS. Open Terminal and drag either eclipse or FlexBuilder into the new terminal window, add a space then type -clean. This should now open either Flex Builder or Eclipse, job done!

I recently needed to copy an Array of nested Value Objects and discovered a couple of issues that I thought I should blog about, for my own future reference if anything (memory ain’t what it used to be). A method such as:

1
2
3
4
5
6
7
8
9
10
11
var my_arr:Array    = clone( old_arr ) as Array;

private function clone( source:Object ):*
{
    var myBA:ByteArray = new ByteArray();
              
    myBA.writeObject( source );
    myBA.position = 0;
              
    return( myBA.readObject() );
}

… will strip your typed objects. ObjectUtil.copy will perform a deep copy but will also strip the object type, the solution is good ol’ registerClassAlias() e.g.

1
2
3
registerClassAlias( "com.newtriks.model.vo.CustomVO", CustomVO ); 

var my_arr:Array    = ObjectUtil.copy( old_arr ) as Array;

For nested typed objects within the array’s value objects then simply ensure your register its class alias.

Please read this more informative post on the subject Darron Schall

UPDATE Post changed with a correct revised method due to previous approach unsettling the custom renderer.

I had a little gripe today with preventing rows displaying the default row highlight within a Flex DataGrid. Rollover highlight is easy to prevent using useRollOver=”false” but ditching the selection highlight is a little trickier. I achieved removing the highlight by overriding the drawSelectionIndicator() method in my custom grid class and passing 0 for the height param. See code below:

Read on →