| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Oct 2001
Location: Minneapolis
Posts: 18
|
I am making a jigsaw puzzle which consists of many movie clips that have the same photo masked out of different puzzle piece shapes.
I can get the pieces to drag around and drop into the correct space just fine, but my mouse doesn't move around the piece directly under it. Rather it seems to grab the entire area of the (hidden) masked photo (meaning it usually picks up which ever piece is closest to the top vs. just the puzzle piece shape). Is it possible to use the hitTest command on a masked layer in a mc so that it only returns the value "true" if on the masked layer and not the entire image hidden behind it? Or is there someway for me to create coordinates on each individual mc so that the mouse drags the one under it versus whichever piece is on top? If this is all too confusing I can post my example. Thanks! |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Oct 2001
Location: Minneapolis
Posts: 18
|
I've posted the swf file at:
http://members.tripod.com/mclarke8/shaverGame.html Unfortunately the fla is too large for me to upload there, but the main question is: how to target the piece that shows through the mask versus the entire masked photo? Add another movie clip on top, combine those and target it instead? If anyone can think of something else to try it would be most appreciated. |
|
|
|
|
|
|
|
|
#3 |
|
two hundred & thirty two
Join Date: Jul 2001
Posts: 334
|
Hi,
Each piece should be in a MC of it's own. Make a button that's the same size and shape as your mask by copying and pasting onto a new layer. Now you have a button under the mask and masked layers add this code to it: on(press){ startDrag(PATH TO MC GOES HERE, false); //change 'false' to 'true' if you want the MC centered on the mouse } on(release){ stopDrag(); } It might be an idea to alter the levels of the MCs too. So when someone clicks one that's the bottom of the pile it rises to the top. cheers. |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Oct 2001
Location: Minneapolis
Posts: 18
|
Thanks poab,
Each piece is its own mc right now, but I'll try the button idea to see if it restricts the hit area. Your changing levels idea is a good one, I'll give that a shot too. |
|
|
|
|
|
#5 |
|
simply g3aky
Join Date: Jan 2001
Location: Denver - CO
Posts: 248
|
Also a little unknown hint. The bounds of the MC is not defined by the mask but by the entire contents of the MC. So you either need to use an invisible button as poab suggested or if you break your image in each MC ie Ctrl or comman -B you can then use the white mouse pointer, the one that you use for modifying bezier curve handles with, and you can grab the corner node of the picture and shrink it to the bounds of the mask. This sounds a little confusing I know but it works.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| hitTest to drag | tinyk | Simple Stuff (Newbies) | 9 | 07-13-2005 12:41 AM |
| remove hitTest?? | toke | ActionScript 1.0 (and below) | 5 | 09-15-2004 07:57 PM |
| hittest problem | caffrey75 | ActionScript 1.0 (and below) | 3 | 08-17-2004 05:10 PM |
| cant re-enable an object. | tg | ActionScript 1.0 (and below) | 0 | 08-11-2003 04:12 PM |