Skip to main content
May 5, 2013
Answered

Datagrid expands when put in movieclip

  • May 5, 2013
  • 1 reply
  • 488 views

Gidday

I wanted a drop shadow on my datagrid, so created a movieclip, put the datagrid inside.

The datagrid's dimension are now all screwy. The header and text is magnified about 5x, and the width of the clip is bizarre.

Shouldn't the DG maintain it's own dimensions when placed inside a clip?

Any idea how this can be fixed?

Thanks for your help.

This topic has been closed for replies.
Correct answer Ned Murphy

The only reason I can see that happening is that the movieclip itself has been scaled.  You shouldn't need to place the datagrid inside a movieclip to get a drop shadow.  You can  apply it directly to the datagrid using AS3.

var dropShadow:DropShadowFilter = new DropShadowFilter();

dg.filters = new Array(dropShadow);

If you want to adjust the properties of the shadow, look up the DropShadowFilter class in the help documents.  The constructor for it is specified as...

DropShadowFilter(distance:Number = 4.0, angle:Number = 45, color:uint = 0, alpha:Number = 1.0, blurX:Number = 4.0, blurY:Number = 4.0, strength:Number = 1.0, quality:int = 1, inner:Boolean = false, knockout:Boolean = false, hideObject:Boolean = false)

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
May 5, 2013

The only reason I can see that happening is that the movieclip itself has been scaled.  You shouldn't need to place the datagrid inside a movieclip to get a drop shadow.  You can  apply it directly to the datagrid using AS3.

var dropShadow:DropShadowFilter = new DropShadowFilter();

dg.filters = new Array(dropShadow);

If you want to adjust the properties of the shadow, look up the DropShadowFilter class in the help documents.  The constructor for it is specified as...

DropShadowFilter(distance:Number = 4.0, angle:Number = 45, color:uint = 0, alpha:Number = 1.0, blurX:Number = 4.0, blurY:Number = 4.0, strength:Number = 1.0, quality:int = 1, inner:Boolean = false, knockout:Boolean = false, hideObject:Boolean = false)

May 6, 2013

Thank you Ned - I'll apply it directly to the DG as you have shown.