I haven't been able to test this with Flex - but here's a way to programatically extend a button's dimension for a normal SimpleButton - which is what a FLA file's button is.
Hopefully you can use a similar way for Flex.
Usage:
// extends the hit area of 'Add' button in the addToCart panel
extendButtonHitArea(addToCartPanel.btnAdd, 10);
// extends the hit area of 'Add' button to the entire 'Add to cart panel' + 10px
extendButtonHitArea(addToCartPanel.btnAdd, 5, addToCartPanel);
Function:
Note: testMode is set to true by default. You'll want to change this to false.
public function extendButtonHitArea(button:SimpleButton, extendBy:int,
hitSprite:DisplayObject=null, testMode:Boolean=true)
{
if (hitSprite == null) {
hitSprite = button;
}
var bounds:Rectangle = hitSprite.getBounds(button);
// create hit area - extended by 'extendBy' all the way aroudn
var hitArea:Sprite = new Sprite();
hitArea.graphics.beginFill(0xCCFF00, .5);
hitArea.mouseEnabled = false;
hitArea.graphics.drawRect(bounds.x - extendBy, bounds.y - extendBy, bounds.width + (extendBy * 2), bounds.height + (extendBy * 2));
// set hit state of button to our new sprite
button.hitTestState = hitArea;
// in test mode add an outline to the 'upState'
if (testMode)
{
var hitAreaVisual:Sprite = new Sprite();
hitAreaVisual.graphics.lineStyle(1, 0xCCFF00, .7);
hitAreaVisual.mouseEnabled = false;
hitAreaVisual.graphics.drawRect(bounds.x - extendBy, bounds.y - extendBy, bounds.width + (extendBy * 2), bounds.height + (extendBy * 2));
(button.upState as DisplayObjectContainer).addChild(hitAreaVisual);
}
}