Experience using Google App Engine, Spring MVC and Flex

April 12, 2011. Posted by Andy Hulstkamp in Actionscript 3, Google App Engine, Spring, flex 4. 4 Comments »
Keywords: , , ,

I had a look at Google App engine and some of the new features in Spring 3 (MVC).

I decided to create a platform for city ratings and –rankings. I polished the whole thing a bit in the hope to attract some visitors. I wonder if I can get some peaks in traffic to see how this service will perform in GAE under load outside of a stress test.

To see what I’m talking abput, a first version is up and running at CityClash.org. To read about my experience with Google App Engine read on after the screenshot.

Building CityClash.org involved a couple of interesting aspects towards Google App Read the rest of this entry »

Ruler Spark Component using dynamic skin parts and custom GraphicElement

October 8, 2010. Posted by Andy Hulstkamp in FXG, flex 4. 2 Comments »
Keywords: , , , ,

Here’s a first version of a simple Ruler component that takes some of the techniques discussed in the couple of previous post into account.

The ruler can be scaled down or up by holding CTRL/SHIFT while clicking and can be moved by holding the ALT-Key and keeping the mouse button pressed. When scaling an animation is applied for smoother transitions. For the labels an array of Strings can be set, each one defining a division on the ruler. The number of subdivisions can be set as well

Spark Ruler Component

Simple ruler component. View source is enabled.


Custom GraphicElement to draw tick lines

Instead of using and FXG-Path element a custom GraphicElement has been created to draw Read the rest of this entry »

Inspecting and creating a custom Spark GraphicElement

October 7, 2010. Posted by Andy Hulstkamp in Actionscript 3, FXG, flex 4. 1 Comment »
Keywords: , , ,

Mobile Flex Apps are around the corner. Hence it might be a good thing to inspect some of the more light-weighted approaches of Flex to create visual elements and components that can take part in the Spark layout process. In this last example I had a look at SpriteVisualElement.

Now, it’s time for the GraphicElement.

custom flower GraphicElement used in background

Example using custom Graphic Elements. View source is enabled.

The GraphicElement and its subclasses are responsible to draw a significant amount of the Spark components graphics. FXG elements like Rect, Path, Line etc. all derive from GraphicElement.

A GraphicElement is actually neither a DisplayObject nor does it offer any form of interaction. Its super class is the EventDispatcher and it uses an Read the rest of this entry »

Flex Tab Key Navigation for custom Spark PopUp

October 6, 2010. Posted by Andy Hulstkamp in Actionscript 3, flex 4. 5 Comments »

This took me a while to figure out.

In a project I created a custom PopUp, nothing fancy, just a couple of text inputs. When I tried to enable Tab key navigation I set the required properties but Flex would simply ignore tab key navigation to the input fields in the pop up.

The Documentation about the IFocusManager states that a pop up will get its own FocusManager and its own tab loop.

After some tracing I found that my pop up and its child weren’t included in the FocusManager as focus objects. In fact, there was no FocusManager for my pop up at all.

The reason for this is that when the PopUpMangerImpl is about to create and configure the pop up, it checks if the pop up is a IFocusManagerContainer so that focus can be added. Read the rest of this entry »

Use SpriteVisualElement to implement a simple component in Flex 4

September 29, 2010. Posted by Andy Hulstkamp in Actionscript 3, flex 4. 3 Comments »
Keywords: , , ,

In Flex 4 the standard way to create a custom control is to extend from SkinnableComponent, then implement the handling and management of events and states there and use a separate skin class for the visual representation of the component.

A class that gets less attention, but might be useful in a couple of scenarios to create a control alternatively, is the SpriteVisualElement class.

This example shows an implementation of a simple ruler by extending the SpriteVisualElement.

Ruler implemented by extending SpriteVisualElement

The SpriteVisualElement

The SpriteVisualElement is a display object that can be used inside spark containers.

It inherits from Sprite and implements the Read the rest of this entry »

Nicer Tooltips and balloon help for Flex 4

May 30, 2010. Posted by Andy Hulstkamp in Actionscript 3, FXG, Sound, flex 4. 24 Comments »
Keywords: , , , , ,

Tooltips are a good way to provide a user with additional information for controls and Flex offers Tooltips out of the box. The default Tooltips are fine but when text gets longer than just a few words usability may suffer.

For a current project, I needed more like a balloon help in place of tooltips and therefore decided not to use Flex default tooltips.

Regarding usability of the tooltips (balloon help) I want to be able to

  • Display an optional tooltip title
  • Display formatted tooltip text
  • Display icons
  • Colorize the tooltip based on the semantic of the invoking control
  • Consistent Placement
  • Have all title, text, styles for the tooltips stored in a central location
  • Have the tooltips work in a generic and Flex-compliant way

Flex gives you a few ways to customize tooltips from registering your custom ToolTip class to intercepting Tooltip events where you can hook up the custom tooltip. All of these approaches fall either short of the requirements I had or would add additional overhead so I simply created a custom ToolTipManager that would alter the behaviour of the default ToolTipManager.

Here’s a demo of the final result, the approch is described further down.


NiceToolTips Demo

Since I like to have all resources centralized, the approach I followed was to Read the rest of this entry »

Updated components to Flex 4 sdk final

May 8, 2010. Posted by Andy Hulstkamp in flex 4. 12 Comments »
Keywords: , , ,

During the past year I’ve posted a couple of custom Gumbo (flex 4 beta) components and skins.

Since they’ve been built on beta sdks, these components might need some adjustments to work with the Flex 4 release sdk.

To save you the work of figuring out what to adjust here are the most requested components updated to Flex 4 release sdk. Click on the images, view source is enabled.

Flex 4 Spark Rating Component. View source enabled. Original post here.

Flex 4 Spark Rating Component

Flex 4 Spark Icon Button based on a generic skin.View source enabled. Original post here.

Flex 4 Spark Icon Button based on a generic skin

Flex 4 Spark icon button. View source enabled.Original post here.

Flex 4 Spark Icon Button

Flex 4 Spark custom checkbox. View source enabled. Original post here.

Flex 4 Spark custom checkbox

Flex 4 Spark custom knob button. View source enabled. Original post here.

Flex 4 Spark custom knob button

Flex 4: change baseColor to chromeColor and useChromeColor=true

April 7, 2010. Posted by Andy Hulstkamp in Actionscript 3, Gumbo (Flex 4 beta), flex 4. 1 Comment »
Keywords: , , , , ,

While updating the Gumbo-Components on this blog to flex 4 final I noticed that the style-property baseColor has been changed to chromeColor.

In addition to this the flag useChromeColor can be set to tell the SparkSkin to use chromeColor for colorization. For custom skins this can be set by overriding initializationComplete() in the skin.

override protected function initializationComplete():void  {
 
	useChromeColor = true;
	super.initializationComplete();
}

Internally Flex checks this flag in updateDisplayList() of a SparkSkin and uses the value in chromeColor for colorization (respecting exclusions in get colorizeExclusions()).

If you are using Gumbo-Components from this blog that use baseColor be sure to make these adjustments.

Custom PopUp Rating Component in Spark Flex 4 (Gumbo)

July 9, 2009. Posted by Andy Hulstkamp in FXG, Gumbo (Flex 4 beta). 14 Comments »
Keywords: , , , , , , , , ,

I was experimenting a little with the PopUpAnchor in Spark Flex 4 and came up with a new custom component for ratings. The new component has the following characteristics:

  • Show a placeholder-icon that reflects the current rating and serves as an interactive element to open the ratings
  • ratings pop up for adjustment
  • both the placeholder-icon and the ratings-icons will be gradually filled with color when adjustments are being made
  • the icons are defined in FXG
  • the icons are not defined in the skin but can be passed as a style for generic use (one skin for different icons and ratings)
  • there is colorization of the icons based on styles
  • smooth transitions when opening the ratings

Here’s a pseudo city-rating demo that shows variations of the component using different icons and color settings for different ratings.

City Rating Component

You’ll find the source at the end of this post. It is Read the rest of this entry »

Advanced FXG Spark Icon Buttons with one generic skin in Flex4 (Gumbo)

June 20, 2009. Posted by Andy Hulstkamp in Actionscript 3, FXG, Gumbo (Flex 4 beta). 36 Comments »
Keywords: , , , , , , ,

For the past couple of days I’ve had a look at creating Spark Icon Buttons. In this post I’ve created an FXG Icon Button with some transitions, leveraging pseudo selectors for states. The Icon was ‘hardcoded’ into the skin. For another Icon I would need to duplicate the skin and introduce another graphic. Not exactly generic. There are other ways to bring graphics into Spark Skins but none of them work with FXG Elements directly.

What I want is:

  • work with FXG Graphic Elements for simpler manipulation and scaling
  • easily export the FXG-Definitions for the icons from a tool and/or be able to change them in FB directly
  • colorize the icons based on a color style-property and do this per state
  • change the icons based on a style-property and do this per state
  • change icons at runtime
  • scaling effect on icon
  • have ONE generic skin, so no duplicates for different icons are necessary

Most of the trouble with generic skins comes from the fact that there is no way to access the FXG Library-Definitions at run-time  (as far as I know) - like getting an instance of a symbol in the library, the way we had in flash. Here’s a hack but I’d rather not use it.

After some headaches I finally managed to get a solution I can live with:

Click here for a test.

You’ll find the source at the end of this post.

The solution regarding the work flow mainly comes down to Read the rest of this entry »