counter for wordpress

Archive for March, 2007

Alex Harui’s Flex Blog

Alex Harui from the Flex SDK Engineering team of Adobe USA has started a blog. The blog can be accessed at the following location.

http://blogs.adobe.com/aharui/

The Blog contains some extremely easy to follow explanations, some great code snippets and examples.Alex is some one almost every flex engineering team guy at Adobe looks upto for their flex related issues.

drag & drop example

This is in response for a query on flexcoders by dave. This example demonstrates drag and drop an image from a list to a canvas where the image is added at the position where the mouse is released on the canvas. This also provides the capability to drag and position the dropped images anywhere in the canvas. Making this example I found this rather strange thing, when you are creating a custom dragImage, for an image control, it requires that you call setActualSize() on the dragImage to make it display correctly. surprisingly, thats not the case when the images are embedded, it works fine even without calling setActualSize().

Usage:

Drag and drop from the list of image names to the grey colored area which is a canvas. Observe that the images are drawn at the location where you released the mouse. Drop a few images, now re-position them in the canvas by dragging and dropping them around.

Enjoy!

Download Source (zip)

FormattedStepper – NumericStepper with formatting support

Saw a post on flexcoders yesterday regarding some one wanting formatter support on NumericStepper. Played around with NumericStepper code base for around an hour yesterday night and this is what I got – <FormattedStepper>, an extended control from <mx:NumericStepper> with a formatter property which can be set to NumberFormatter or CurrencyFormatter. The control can be used as a regular NumericStepper too. I have attached a sample application and full source code also. This is version 0.0.1, may have a lot of bugs, but for starters, it works!

Sample Usage:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:xm="com.*" backgroundGradientColors="[#000000, #000000]"> <mx:CurrencyFormatter id="formatter" currencySymbol="$" alignSymbol="left"/>
<xm:FormattedStepper id="fs" formatter="{formatter}" minimum="1000" maximum="2000" stepSize="2"/>
</mx:Application>

Sample Application | Download Source (zip)

Small textarea enhancement

I met Avinash, Kislay and Amrit from sungard last sunday at the flex users meet organized by Mrinal and Abdul. John Koch, the APAC develper relations manager of Adobe was the main guest. Raghu, I and Sameer joined in from the flex team. Amidst a conversation, Amrit pointed out that he couldnt drop a text into a specific charecter location while doing a drag drop to a text area from a list or a similar source. The dropped text gets appended to the beginning or the end of the text. Seemed to me that some simple tricks would solve this issue.

There is a UITextField instance inside the TextArea control which is protected, Hence I had to extend the TextArea control to actually prototype this capability. So, here is a hacky first draft of the drop-at-cursor-location capability into a TextArea. Currently doesnt work with htmlText, that will come soon though. Thanks Sameer for the drag and drop tips.

How does it work?

Simple! After subclassing TextArea, on mouseUp, call the getCharIndexAtPoint() method of UITextField to find out the charecter index at the cursor position. Now, appending a text at that position is very simple.

Sample Application | Dowload Source

ForthComing: Cursor locations to update on keyBoard navigation, HTMLText support [:)]

the first post

What is flexgeek?

Adobe Flex Components, tips and tricks, sample applications, flex news aggregations, and many more cool stuff relating to the coolest RIA development framework – Adobe Flex. Time to time, flexgeek will be posted with tutorials on developing flex applications as well as sample applications / code snippets that will make flex even more exciting to the flex connossieurs. Lets rock the RIA world with the best thing that ever happend to the internet! – Adobe Flex.