View Full Version : detecting clicked overlapping movie clips
jmg
August 12th, 2003, 08:47 PM
Hi, i have a flash 5 app where i can drag movie clips around the stage. They can overlap, and when i click on one i move it, but when they overlap, how can I select only one movie clip, and the one that is on top. I have a button that lets me swap depths for each movie clip so I want to select only the one movie clip.
Thanks for your help, this is urgent.
comicGeek
August 14th, 2003, 07:39 AM
place your button inside that movie clip. and instead of directly placing a number on the swapDepths, use a variable on the movie clip's previous timeline. for example you have a movie clip with a button on it use this script:
on(release){
this.swapDepth(_parent.top);
}
and on the timeline where your movie clip is placed place this script:
top = 9999;
so when, for example you have 5 movie clips on the same timeline, when you select anyone of them they go to the depth specified by the variable top which in this case 9999.
Hope this helps! :)
jmg
August 14th, 2003, 12:52 PM
But when they overlap, all the objects that are overlapping will come back true with a hit test... so how do i determine which one of the overlapping ones is on the highest level?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.