pmarquis
04-16-2007, 09:54 PM
Hey all, I'm trying to keep people from clicking different areas of a movie-button, so they only click on the 'click here' aspect of the movie. Not sure how that works without deleting all the graphics from the hit frame.
Just tried using hitArea property and it doesn't seem to work, probably because the movie clip referenced (clickhere) is within the other movie clip (button1).
wvxvw
04-20-2007, 08:13 AM
HitArea should do the task
function rect(_mc:MovieClip, w:Number, h:Number, c:Number):MovieClip {
_mc.beginFill(c, 100);
_mc.moveTo(0, 0);
_mc.lineTo(w, 0);
_mc.lineTo(w, h);
_mc.lineTo(0, h);
_mc.lineTo(0, 0);
return _mc;
}
var parentClip:MovieClip = _root.createEmptyMovieClip("parentClip", _root.getNextHighestDepth());
parentClip = rect(parentClip, 300, 300, 0xCCFFBB);
var childClip:MovieClip = parentClip.createEmptyMovieClip("childClip", parentClip.getNextHighestDepth());
childClip = rect(childClip, 200, 200, 0xFFCCBB);
childClip._x = 50;
childClip._y = 50;
var hitAreaClip:MovieClip = parentClip.createEmptyMovieClip("hitAreaClip", parentClip.getNextHighestDepth());
hitAreaClip = rect(hitAreaClip, 100, 100, 0xBBCCFF);
hitAreaClip._x = 100;
hitAreaClip._y = 100;
childClip.onRelease = function():Void {
trace(this._name);
}
childClip.hitArea = hitAreaClip;
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.