Wednesday, March 9, 2011

Scaling a text field with styleshhet

For long time I thought this is some memory leak or something. All I had was a 2D carousel did in AS3, running continuously. All these carousel items had one image and some text. Running this carousel on Flash Player 10 was taking hell lot of CPU and physical memory (not RAM). Some times it went up to 15 GB and crashed application. What I observed was memory usage kept on moving up but it didn't come down even when I stopped this animation.

After weeks long debugging I finally figured out this is an issue with scaling dynamic text field with style-sheet. We decided to scale only image rather than image and text. So when you are observing high memory usage without any reason, make sure you are not scaling dynamic text field with style sheet assigned to it.

Friday, December 24, 2010

Removing borders in Flex Datagrid

I had an requirement where I was using ItemRenderer for Flex DataGrid cells and there was some 2 pixel border around these ItemRenderers. I tried whatever I could and even we had to ship the project with those ugly border for QA. finally I figured out those borders are not borders at all. they are the default padding given around DataGrid cells. You have set them to "0" using CSS. for removing all lines in and around DataGrid my CSS look like this.

.myDataGrid{

use-rollover:false;

borderStyle: none;

alternatingItemColors: #FFFFF7, #FFFFF7;

verticalGridLines: false;

horizontalGridLines: false;

paddingLeft: 0;

paddingRight: 0;

paddingTop: 0;

paddingBottom: 0;

}



Welcome to Flex Kid

Welcome to my new blog Flex Kid, and yes I am the Flex Kid. Here you will find questions I had to tackle and answers I found.