View Full Version : FMX movieclip hit areas
borispc
July 29th, 2003, 01:23 PM
Hi!
This is a pretty simple thing but I'm not sure what is the best way to do this.
How do you define the "hot spot" for a movieclip?. Let's say you want to define what part of that movieclip is sensitive to the cursor within that same movieclip in a frame. (like the Hit Frame in a button object). The Hit Area property seems to only refer to other movieclips, and not able to define it as a specific frame.
Thank you everyone!:p:
senocular
July 29th, 2003, 01:41 PM
1) either use a button instead or
2) use hitArea with a movieclip
You can always set the hitArea movieclip to have a _visible of fase, then it wont be seen.
borispc
July 29th, 2003, 01:43 PM
thanks...I know those are options...just want to know if the hit area can be defined within the same mc. (not a nested mc either). A button is not an option, it needs to be a mc.
liam
July 29th, 2003, 01:55 PM
boris -
you could also create a transparent .gif file and then import it into flash; then place it on the bottom layer of your movie clip and make it available on the frames you need.
borispc
July 29th, 2003, 02:03 PM
thank you everyone. The most straight forward way to do this (in my humble opinion) is the following:
just draw the hit area in the bottom layer of the movieclip and then make that 0% transparent with the color mixer. Just like what Liam proposed but with no need of importing the gif, all in flash. thanks again.
kode
July 29th, 2003, 02:04 PM
You could fake it too...
Use an onMouseDown handler and an if action to check the mouse position, something like this:
myMovieClip.onMouseDown = function() {
var xm = this._xmouse;
var ym = this._ymouse;
if (xm>20 && xm<40 && ym>20 && ym<40) {
statement(s);
}
};
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.