PDA

View Full Version : MovieClip hover options


ejewels
04-12-2007, 04:37 PM
hello,
I often find myself creating movieclips to be used as buttons. Many times they just have text inside. I usually make a new layer within the movieclip called "hover" where I have to draw out a box to cover the area I actually want to be active and make the alpha "0". Is there a way to make Flash not just hover on the shapes / text inside a movieclip but rather just hover over everything in the area of the MC? I'm getting really sick of doing the extra work just so that the hover covers the entire area box of the MC...Thanks in advance

CyanBlue
04-12-2007, 04:40 PM
I could be wrong, but I think you will have to do what you just said to make sure it works as a clickable area...

ejewels
04-12-2007, 05:16 PM
Yeah, I hope not...I thought I remember seeing once that you can specify something with code...could be just day dreaming though...

CyanBlue
04-12-2007, 08:15 PM
You could set the hitArea of the movieClip but it pretty much is the same thing as drawing one...

jcodec
04-13-2007, 06:56 PM
You can create a simple script to draw your invisible shape over the extents of the button MovieClip instead of doing it manually. Here's one that may work for you:


test_mc.onRollOver = function() { trace("Roll Over"); };

function createHitArea(mc:MovieClip):Void {
var hitAreaMc:MovieClip = mc.createEmptyMovieClip("hitAreaMc", mc.getNextHighestDepth());
hitAreaMc.beginFill(0x00FF00, 0);
hitAreaMc.moveTo(0, 0);
hitAreaMc.lineTo(mc._width, 0);
hitAreaMc.lineTo(mc._width, mc._height);
hitAreaMc.lineTo(0, mc._height);
hitAreaMc.lineTo(0, 0);
hitAreaMc.endFill();
}

createHitArea(test_mc);