PDA

View Full Version : Click Area Problem



sirwebster
March 11th, 2009, 12:35 PM
I've tried searching for an answer to this, but search just presents me with a blank page.

Anyway, i have a MC on the stage created with a class that extends movieclip, the constructor is below



public function editArea()
{

var theBorder:DropShadowFilter = new DropShadowFilter(0, 0, 0x000000, 100, 4, 4);
filters = [theBorder];

graphics.beginFill(0xffffff);
graphics.lineTo(427, 0);
graphics.lineTo(427, 427);
graphics.lineTo(0, 427);
graphics.lineTo(0, 0);

var theMask:Sprite = new Sprite();

theMask.graphics.beginFill(0x000000);
theMask.graphics.lineTo(427, 0);
theMask.graphics.lineTo(427, 427);
theMask.graphics.lineTo(0, 427);
theMask.graphics.lineTo(0, 0);

addChild(theMask);
mask = theMask;

theInner = new MovieClip(); //declared outside constructor
addChild(theInner);

}
the problem i'm having is that from about 2/3 of the way across and 2/3 of the way down, it won't register clicks, i've put an event listener in the Main class that just traces the target, and to the right and bottom of the editArea MC it traces nothing at all, this is most frustrating as when i put other objects into the editArea they can't be clicked in that region either.

hope i've been clear, any help would be awesome as it's driving me nuts

GrndMasterFlash
March 11th, 2009, 12:56 PM
hummmm, here is a stab your ya



theMask.mouseEnabled = false;

sirwebster
March 11th, 2009, 01:00 PM
nope, that didn't fix it, if i comment out anything to with the mask, the clicks register correctly, but sadly i need the mask

sirwebster
March 11th, 2009, 01:05 PM
fixed, i just had to swap a few things around, most odd



theInner = new MovieClip();
addChild(theInner);

theInner.mask = theMask;
addChild(theMask);


feels like more of a workaround than a fix, but at least it works, thanks for your reply, steered me onto the right track