Set custom cursor using the CursorManager

November 18, 2009

After my previous post about setting the busy cursor, I decided to write a next post about custom Cursors. In our example we use an Image as a Cursor source, but you can also use a SWF file.

The CursorManager allows you to use your custom cursors in a very simple way. The most important method is the setCursor() method, which can be used as follows:

1
CursorManager.setCursor(myCursor);

Read more

Flex Timer Example

March 25, 2009

Let’s say you want something to happen in your application every once in a while automatically. The Timer class is the way to do it. I was already familiar with the Timer class from C#, the Flex one isn’t all that different. Let’s create a simple exmple, just switching an image every XX seconds.

Read more

Image as Button in a DataGrid

February 14, 2009

Just as the MouseWheel controlled slider idea, I had this idea when I was working on my flex MP3 player as well. I wanted to give the user the possibility to add tracks to a playlist by clicking a small plus icon in a DataGrid. There are a couple of things that have to be done to achieve this:

  1. Use an itemRenderer to show an Image instead of text
  2. Put the image in button mode so that it can be clicked
  3. Put an event handler on the click or double-click event of the image
  4. Code the event handler

Read more

Images in DataGrid depending on data

February 13, 2009

Flex DataGrids are usually used to give the user some overview of data. Sometimes we want to use a certain value in the data to describe something else (derive a value from the data).
For example, we want to display if a product is in stock yes or no using the following data:

Read more