December 13, 2012

Hi All,

I have moved my blog from www.flexonblog.wordpress.com to www.99thoughts.com/flex_blog.

Sorry for any inconvenience, please update your links and such.

Hope to look forward to your support.


Image Cropping in Flex

January 31, 2011

Even though there are many posts on this particular topic still there are many ???, then i thought may be i can write about it, so lets get started.

Lets do things in steps.

  1. Load Image in to Flex App
  2. Convert it to Bitmap and BitmapData objects.
  3. Crop Image using BitmapData object

1.Load Image in to Flex App

private var imageLoader:Loader = new Loader();

private function fnInit():void
{
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadImageComplete);
imageLoader.load(new URLRequest(“assets/flower.png”));
}

2.Convert it to Bitmap and BitmapData objects

private var bitmapImage:Bitmap;
private var bitmapDataImage:BitmapData;

//Event.COMPLETE eventHandler for Loader

private function loadImageComplete(e:Event):void
{
bitmapImage = Bitmap(e.target.loader.content);
bitmapDataImage = Bitmap(bitmapImage).bitmapData.clone();
}

3.Crop Image using BitmapData object
Read the rest of this entry »


Tip on LinkBar control in Flex

December 20, 2010

LinkBar control defines the style name “linkButtonStyleName” to specify styles for link buttons, but does not define a style name for a selected link button.For example if you want to apply a specific style for a selected link button in the row of link buttons, you would think for a while, make some try outs, look in to the code, scratch your head for a while,curse flex and may be finnally give up.The real thing is it isn’t defined.But there is a way.

LinkBar control defines a row of LinkButtons, meaning we can access and apply styles to any of these individual Buttons at run time using setStyle method.

Example: Button(lnkBr.getChildAt(0)).setStyle(“fontWeight”,”normal”);

In the above line lnkBr is id of the LinkBar and getChildAt method gets that particular button and then we can apply style to that button using the setStyle method.

Demo

Code

 


Display ToolTips for Combobox List items in Flex4

July 13, 2010

Few months back i made this post in Flex3, it was buggy and i figured later it may not be possible here with my logic.Then comes the Flex4, did anyone tell you Flex4 is awesome, yes it is.The same requirement where you want to show tooltips on comboBox List items on roolover can be achieved easily in Flex4.You may have to read about the new ItemRenderer Class and its architecture for better understanding the code and you can go figure your own requirement then.

Download code below.

Read the rest of this entry »


Flash,Steve Jobs,Adobe: what do you think?.

April 30, 2010

If you haven’t read it, please do so.

So after reading the longggggggg page, i just thought a few too.

1.Did he just pull a fast one?.
2.Why is he directly blaming Flash(Adobe)?, I smell something fishy.
3.What does the Microsoft think about this?,  The enemy of my enemy is my friend.
4.I find only two thoughts reasonable,
 -Third, there’s reliability, security and performance.
 -Fourth, there’s battery life.
5.Repetitive thought, we follow all open standards [HTML5, CSS and JavaScript ...], yeah like they create them and we should follow them.:-)
6.How come Flash works on Android phones?.May be Apple needs to enhance their products.
7.What’s Adobe reaction?.
8.There’s always thrist for new experiances, can’t stick to one standard/technology for a long time, and especially in this era whether PC or mobile.
9.Why did we adopt to Flash for web and Why is that difficult for mobile.Its been 40 years since man set foot on moon, did they make it or fake it.
10.It really doesn’t matter for the end user/customer who owns what, what really matters is that who can satisfy him/her.
11. And there’s a lot more …………………..

i am really tired of this shit, so if you people have any thoughts on this just comment.


Tip on Panel Class in Flex

December 16, 2009

Often hear questions on Alert Control like, remove default Button(OK),add new Button’s and so on.., and on TitleWindow like, re-arrange close Button to top-left,add new Buttons and so on..

One thing we got to notice at first is that TitleWindow and Alert are Classes which are derived from Panel Class, which in turn is derived from Container Class, so Alert and TitleWindow are sub-classes of Panel Class, they are created by addding new functionality[methods and properties] to the Panel Class.And the final tip is that, look in to the code,look in to the Class Diagram and if you dont have one then download it here , make a print and stick to a wall near you.

So, having said that you need to decide an appropriate implementation based of your requirements.Example, if you dont want to show OK(default Button) Button on the Alert Control,then better not to use Alert Control, go for a Panel,which is appropriate.

Below fig shows the Relational Diagram of Container,Panel,Alert and TitleWindow Classes.

Relational Diagram of Panel,Alert,TitleWindow

Enjoy the Post.


Sorting Date’s on ArrayCollection in Flex

November 16, 2009

First things first, read about the mx.collections.Sort Class before going in to the code below.

About the Post,suppose i have a AC[ArrayCollection] like below;

[Bindable]
private var arrClldetails:ArrayCollection = new ArrayCollection([
{Fname:”Kranthi”, Lname:”Kata”, dob:”21 Sep 79″},
{Fname:”Vasanth”, Lname:”Lola”, dob:”11 Jun 80″},
{Fname:”Manoj”, Lname:”Pati”, dob:”16 July 81″},
{Fname:”John McClain”, Lname:”Mela”, dob:”15 Feb 72″},
{Fname:”Ross”, Lname:”Geller”, dob:”02 Jan 74″},
{Fname:”Chandler”, Lname:”Bing”, dob:”18 Oct 76″}
]);

Now i want to Sort the “dob” Date field in the AC.,so for this i need to
write a compareFunction for Sort which in turn is applied to the AC like below,

Read the rest of this entry »


Follow

Get every new post delivered to your Inbox.