Monday, August 30, 2010

Do you need additional framework for Flex 3 or 4 development?

I am of strong opinion that you don't need any additional framework for Flex 3 or 4 development. If you follow codebehind in Flex development with custom event handling solve lot problems you try to handle with additional framework (e.g. famous PureMVC & Cairngorm)

more later..

Friday, July 16, 2010

Flex Builder internal error - Right click to find more information

If your project compile perfectly fine one day and next day you get "Flex builder internal error: Right click to find more information" check out following link from Adobe.

Adobe Link for error


Basically chances are very high you might have added new file or changes where you have blank switch statement.

switch(case){

}


You can remove it or add default and project will compile again. Small things but makes life tougher sometime.

Enjoy.

Friday, July 9, 2010

Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found

If you see the above error don't waste much time but debug your application from start point i.e. s:Application (flex 4) or mx:Application (flex 3) and see if you have any custom preloader. If you have provided wrong url it will fail.

Otherwise make sure your images are in right path basically it is URLRequest (url--> problem)..

Enjoy

Sunday, June 20, 2010

Never apply CSS while to textarea using styleSheet property

var myCSS:StyleSheet = new StyleSheet();
TextArea.styleSheet=myCSS;


Instead of attach to TextArea add CSS related code to HTML code.

i.e.

TextArea.htmlText("html tag with css class just like your normal HTML")

will work in all type of browser and scenario where you are fetching RSS feed into TextArea (which will get reloaded every time you have new feed)


Enjoy.

Sunday, May 30, 2010

FocusManager getIndexOfNextObject in Flex Application

mx.managers::FocusManager/getIndexOfNextObject

Error means FocusManager is looking for mxml component to set focus, when hit tab from flash object and fun part you don't have any mxml component to set focus.

Here is the trick create mx.button component and setStyle to null. It will invisible and focus manager can find the component to focus. Now application won't crash or hung.

myButton.setStyle('skin', null);

(mx:Button skin='{null}' )

.myButtonStyle {
skin: ClassReference(null);
}

(mx:Button id="myButton" styleName='myButtonStyle')

Enjoy.

Friday, May 21, 2010

Dynamically resize nested Flex List with variableRowHeight

I was stuck recently with a Flex component that had a List with an itemRenderer. The itemRenderer contained another List with an itemRenderer. Now the problem with this is that the data had unique counts and the lists had variable row heights (variableRowHeight = true). The result was that containers would not dynamically resize enough to display the whole List. In other words, the List was clipped and vertical scroll bars were displayed.

Sounds familiar to me when I had same problem as above developing comment component. I found solution in following blog

1. Link to the reference blog


2. You can also visit another blog post with good example for same problem

Bryan Bartow


Hope that helps.

Sunday, May 2, 2010

Dynamically change height of TileList

You have to adjust rowCount of Tile List to make height according to data at runtime. In below example if column count is 1 you rowCount="data.length()". Now data can be XML children.length() or array.length or any data length.

[mx:TileList id="_videoList" rowCount="{data.length()}" updateComplete="changeHeight"]

You can also updateComplete if you have column count more than 1.

private function chanegHeight():void{
var rc:int = Math.ceil(data.length() / _videoList.columnCount);
if (_videoList.rowCount!=rc) _videoList.rowCount = rc;
}

Cheers,
Nehul