Sunday, December 14, 2008

Add scrollbar to the left corner of VBox

Just a quick tip:

Many of us including me are trying to adding scrollbars in the left side of the containers instead of the right side:

Here is a solution, may be you have already found it somewhere.

1. Create a custome component extending it to VBox.
2. override its updateDisplayList method in the following way:

protected override function updateDisplayList( w:Number, h:Number ):void
{
super.updateDisplayList( w, h );

if( verticalScrollBar && verticalScrollBar.visible )
{
verticalScrollBar.scrollRect = new Rectangle(w,0,-w,h);
}
}

3. You are done ;)

Monday, June 2, 2008

Importing Component classes in Flash CS3

Just to Note:
Components in Flash CS3 must appear within the library, even if you want to use them programmatically.

Wednesday, March 12, 2008

Access an ovelapped Button in flex

If you have a component which is overlapping a button, you will not able to access that button. To access a mouse event on that button, you should have to set the mouse children property of the above component to false.

For example:

myabovecomponent.mouseChildren = false;

Removing Focus from any flex Component

Days are gone when we use _focusrect in flash to remove the ugly yellow focus from focussed movieclip/buttons. In flex we can remove focus from particular component by setting its focusalpha style to 0.

For example suppose you want to remove focus from TextArea component you can use:

mytextareainstance.setStyle("focusAlpha",0);

Hope this will help.