Came across changing registration point of a flex component from (0,0) to (x,y)..
DisplayObject class has a property 'transform' which contains object of Matrix.
var do : DisplayObject = new DisplayObject();
var matrix : Matrix = new Matrix();
matrix.tx = x;
matrix.ty = y;
do.transform.matrix = matrix;
That's it..
Tuesday, March 31, 2009
Monday, January 12, 2009
Flex Date class
I found a bug in Date class of AS 3.0.
Its assumed that always date object is an idle solution for few timer based events.
But, the date object after continuous access over a period of 2 seconds will not show any
difference in the output.
Try this...
var d0:Number = (new Date() ).getTime();
var d1:Number = (new Date() ).getTime();
// iterate this.. you will get same values for both d0 and d1
trace(d0 +" - " + d1);
Its assumed that always date object is an idle solution for few timer based events.
But, the date object after continuous access over a period of 2 seconds will not show any
difference in the output.
Try this...
var d0:Number = (new Date() ).getTime();
var d1:Number = (new Date() ).getTime();
// iterate this.. you will get same values for both d0 and d1
trace(d0 +" - " + d1);
Tuesday, December 30, 2008
Flex ASDoc
The worst part after completing a flex project. The asdoc tool provided by flex builder, is just sucker of time. What the hell, it give all invalid compiler problems, when generating asdocs, and hangs up!!! Looking for a turn around!!
Thursday, October 30, 2008
Flex Performance issue and Profiling
Today,
I am hit with big performance issue in flex and started to analyze the code with Flex Profiling,
but that really didn't help me much. I found that the flash animation I am using in flex has glow effect designed in flash timeline, which is utilizing 100% CPU.
It's always better to use GlowFilter/Glow classes in code rather using time line based animations.
I am hit with big performance issue in flex and started to analyze the code with Flex Profiling,
but that really didn't help me much. I found that the flash animation I am using in flex has glow effect designed in flash timeline, which is utilizing 100% CPU.
It's always better to use GlowFilter/Glow classes in code rather using time line based animations.
Tuesday, October 21, 2008
QWERTY keyboard
Worked on a new flex on-screen virtual keyboard, qwerty one.
I found in only one site regarding the flex keyboard. The problem with that is, you have to register the text input everytime. But I created one that does not require any registration of text inputs.
If the focus is in text input, the keyboard detects.
Its as simple:
Its as simple:
Saturday, October 11, 2008
Flex ArrayCollection and addItemAt() problem
The other day I was banging my head, for adding an item to the ArrayCollection Object at zero th index. The item simple adds to the end of the list, but I want to add it to the start of the arraycollection.
The case scenarion is like this:
var col:ICollectionView = new ArrayCollection(); col.addItem("California"); col.addItem("Arizona"); var sort:Sort = new Sort(); // There is only one sort field, so use a null first parameter. sort.fields = [new SortField(null, true)]; col.sort = sort; col.refresh();//now add an item at the 0 th index
col.addItemAt("Alaska",0);//The above statment simply fails, it adds the item at last position
//The reason is you cannot use addItemAt() after applying a sort to the ArrayCollection. It simply
// adds to the end. Ignore either sorting or adding an item.
Subscribe to:
Posts (Atom)