Author Archives: Tony - Page 2

Flex and Fluorine Custom Class VO’s and .NET

When working with Flex and Fluorine, it has become very tedious for me to create my custom class objects with many properties. I created a quick tool to take some of the burden of creating these objects on the Flex and .NET side.

Anyone who uses private, public properties in their Value Objects (VO) objects know it is a pain to type all those properties into a custom object. Afterward, go over to .NET and create them. About as tedious as watching paint dry in zero degree weather.

Try this tool out and let me know if it is helpful for you.

Class Generator

How to use:
1. Type the class name into the input box.
2. Add properties to the properties grid. Edit the values.
3. Add the Class to the class grid.
4. Repeat for next class.
5. Make sure to cache your classes to local disk using the Cache buttons at the top. Nothing is saved on a server, all data is stored local in SharedObjects.
6. You can make a class active by selecting it in the grid.
7. You can copy the code from the Text Area.
8. Click on the code you want to generate.

Simple, but I hope this is of use to somebody. It saves me at least 10 minutes per VO.

Let me know what you think. This was a quick and dirty throw together. If enough people think there is value I will consider improving. I am also not apposed to creating a ToDo/Wish list for the tool.

Enjoy,
Tony

Flex Preloader Example

You want to be able to write your custom preloader in FLEX?

Jesse Warden will be able to walk you through it here.

Before you leave to go write your new preloader, make sure to read my comment on needing to remove the event listeners when you are done.

Summary:
Awesome stuff! There is a caveat to consider.

1. The preloader overwrites the event Listeners, but leaves them once the application is loaded. This is ok if you never load anything else into your flex application. If you load a module into your application, flex will fire the FlexEvent.INIT_PROGRESS event again causing an error due to the clip.preloader becoming null.

2. Solution:
Instantiate a private variable called _preloader in your constructor;

private var _preloader:Sprite;
public override function set preloader(preloader:Sprite):void
{
_preloader = preloader;
_preloader.addEventListener( ProgressEvent.PROGRESS , onSWFDownloadProgress );
_preloader.addEventListener( Event.COMPLETE , onSWFDownloadComplete );
_preloader.addEventListener( FlexEvent.INIT_PROGRESS , onFlexInitProgress );
_preloader.addEventListener( FlexEvent.INIT_COMPLETE , onFlexInitComplete );
centerPreloader();
}

Remove the listeners once the application is loaded and you are complete;

private function onDoneAnimating():void
{
clip.stop();
_preloader.removeEventListener( ProgressEvent.PROGRESS , onSWFDownloadProgress );
_preloader.removeEventListener( Event.COMPLETE , onSWFDownloadComplete };
_preloader.removeEventListener( FlexEvent.INIT_PROGRESS , onFlexInitProgress );
_preloader.removeEventListener( FlexEvent.INIT_COMPLETE , onFlexInitComplete );
dispatchEvent( new Event( Event.COMPLETE ) );
}

Extending Flex TextInput to capture Enter Key

I have many customers who use text entry very heavily. The users always ask for as little mouse use as possible when entering data into the application. To solve this, I have extended the TextInput and Button to listen for the Enter key and fire an event similar to a click of the mouse. There is a visual helper on the control taken from an article that allows the user to see very quickly what was not entered and what has been entered (as long as the developer uses a colored background).

The developer can now place these text input boxes all over the screen and when a user finishes entering into the field the enter key will cause the focus to change to the next box.

ExtendingControls Demo
Put focus in one of the boxes; Hit the enter key; You will see the focus change; Try not to use the mouse (hard for me at first).

ExtendingControls Source

You can also right click and View Source.

I hope this can help someone out.

Flex DataGrid ItemRenderer Gotcha

Struggling with a datagrid in flex taking too much memory?
Your datagrid is too slow?
You thought you could just use any component container as an item renderer?

These are the gotcha's of the flex datagrid.

Here are two blog posts by Alex Harui from Adobe that explain how to make sure your datagrid does not get bogged down when creating item renderers.

Thinking About Item Renderers
More Thinking About Item Renderers

He put up source demos, but the source must be downloaded to view.
I have set up the examples with source for you. You can right click any of the examples to browse the source.
Item Renderer Demos

Hope this helps you as much as it helped me.

Flex Builder 2 Starts and Stops with Error

I had an interesting problem today.

Flex Builder 2 crashed while I was working on one of my projects using a custom workspace. Flex Builder will start then stop with an error to go look at the .log file in your .metadata directory in your workspace.

There is a handy .metadata directory with a .log file in it and it gives you all kinds of information about the problem. (this is an eclipse structure; I believe).
In this .log file I found an error:
!ENTRY org.eclipse.core.resources 2 10035 2007-05-24 19:44:08.812
!MESSAGE A workspace crash was detected. The previous session did not exit normally.

Now to solve the issue:
With a little luck and some guess work, I found that you can go to the directory for your workbench config files and fix the problem.
[workspace dir]\.metadata\.plugins\org.eclipse.ui.workbench

In this directory you will find a file called workbench.xml
Rename it to something else (because I like backups), then start Flex Builder again.
You should be able to open the workspace without a problem.

Good Luck!

Create Site Icon

I am always trying to find a good icon editor. Well now I do not need one.
An internet site will create one from an image file you have and download the created ico file.

I should have thought of this myself. I am going to blow their horn, because they beat me to it. Great Job on this one.

Free Favicon Generator Free Icons

WordPress wins over BlogEngine.NET

3alves_logo_640

After years of looking at blog applications, I have decided on a mashup of blogging platforms.

WordPress

WordPress wins out as my new main blogging software.  Cannot beat the support, many themes, social setup, etc.
I will be using other services for sub-blogs.
These sites allow for subdomain redirect and are very easy to use and blog with.  I will give a summary of the blogging on these sites on my main blog, but will not be using my main site for these focused blog sites.  These include, but not limited:

Tumblr.com

Posterous.com

Although the blog sub-site is now obsolete, the content will stay in place not to break old search engine links.
Also, some people may still have use for the old information. Note:  All posts have been imported into the new site.