August 30th, 2012 — actionscript, datagrid, examples, flex, itemrenderer, label
A common problem with a Flex datagrid is that very often you cannot select the items in a particular row/column to Copy either using the mouse or using Ctrl+C. There is a very simple solution to this problem. All you need to do is, add a Label itemrenderer to the Datagrid Column and set the selectable property of this Label to true. There you have it, a Flex Datagrid now with selectable fields!
Working code to example to follow very soon!
August 26th, 2012 — actionscript, flex, numericstepper
A numeric stepper is a input/display control which let’s the user select a number from an ordered list.
Some of the important and most frequently used properties of a numeric stepper are:
1> maxChars (int) – This specifies the maximum number of characters that can be entered into the Numeric Stepper. An important point to be noted here is that the default for this is 0 which means that there is no limit on the character length.
2> maximum (Number) – This specifies the maximum value that can be entered in a Numeric Stepper.
3> minimum (Number) – This specifies the minimum value that can be entered in a Numeric Stepper.
4> stepSize (Number) – This specifies the number which is added/subtracted on step up and step down respectively. The default value for this is 1.
A simple example is given below:
August 26th, 2012 — actionscript, corner, examples, flex, radius
There will be some cases where you will need to round the edges or corners of some Flex components to make it look slightly different and sometimes better than the plain vanilla components that the Flex SDK provides. A simple trick to achieve this is to set the cornerRadius. Setting the cornerRadius to say 15 will give you about a decent curve on the edges. You can play around with this property more to get the rounding you desire!
<mx:Canvas width="140" height="140"
<mx:Label text="Canvas" horizontalCenter="0" verticalCenter="0"/>
Live example with View Source will be up here very soon.
July 16th, 2012 — flex, html, iframe, silverlight
I had to embed a Silverlight application inside an iFrame and it worked for Internet Explorer and Google Chrome but it wouldn’t work in Firefox. After a lot of frustration looking into the properties and mucking around and googling, I found the solution in this thread here.
All I had to do was to change the windowless property of Object tag to false, and the Silverlight application inside IFrame started to work.
<param name=”Windowless” value=”false” />
July 14th, 2012 — application, disable, flex
The application object has a boolean value called enabled which can be set to true/false if the application needs to be enabled/disabled respectively. You might come across some cases where a Progress bar loads and you don’t want the user to click on anything in the app. That would be the most common usage for this.
Another cool thing that you can see from this example is that whatever code you write after the application is disabled, something like a popup for Alert is going to be accessible. So you can click on the OK button to continue working with the app.
View source is enabled in the following example.
Download the source code here.