Amit Shrestha


Following  few list of flex problem’s solutions, that i encountered:

  • Asynchronous testing

  • Autoscrolling [Works for displayobject with baseclass as Container]

— AmitShrestha – 19 Aug 2008

  • Problem with mouseUp event:

Problem: i did as “a.addMouseListener(mouseUPEvent,function)” , i did mouse down in “a” and then mouse up “a” mouseUpEvent is fired,Now i do mouseDown in a child of “a” then drag the mouse outside of “a”[the child is dragged with mouse] then i did mouseUp , no mouse event fired:

solution : “a.systemManager.addMouseLitener(mouseUpEvent,function)”

While scrolling the datagrid label disppears and appears randomly:

if(some logic ){ statusDueDateBox.removeChild(assignedBy) }

< mx:Label text=”{‘Assigned by: ‘+}” id=”assignedBy” / >

the “assibnedBy” label disappears in a radom pattern while scrolling

solution: if(some logic ){ assignedBy.text=””; }

Reason: unknown


  • Copying to clip Board:

  • Setting hand cursor
use attributes:  buttonMode="true"  useHandCursor="true"
but for labes ,text you have to do:  mouseChildren="false" buttonMode="true"  useHandCursor="true"

  • Preventing Row Highlight in a Flex DataGrid

  1. /**
  2. * Override the below method:
  3. * (1) Stop the row highlight selection.
  4. */
  5. override protected function drawSelectionIndicator( indicator:Sprite, x:Number, y:Number, width:Number,
  6. height:Number, color:uint, itemRenderer:IListItemRenderer):void
  7. {
  8. super.drawSelectionIndicator(indicator, x, y, unscaledWidth – viewMetrics.left – viewMetrics.right, 0, color, itemRenderer);
  9. }


  • changing skin of HSlider:

.volumeSlider {
track-skin : Embed(source=”skin_slider_red.gif”);

  • Cancelling drag drop operation when user hit’s escape

listen for key event at the main application then on key down do :

private function keyDownEvent(event:KeyboardEvent):void {
if (event.keyCode == Keyboard.ESCAPE) {
// todo
var dragProxy: DragProxy = DragManager.mx_internal::dragProxy; // get drag proxy
if (dragProxy != null) {

dragProxy.mouseUpHandler(new MouseEvent(MouseEvent.MOUSE_UP));//provide some thing for mouse up


  • useful links:

sytle explorer :

1 Response to "Flex"

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: