Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : hit target make invisible


kaliedo
5/20/2004 10:07:25 PM
okay guys a diluted version of my original question -how do i make a movieclip in another scene invisible on a hit target action from another movieclip.

cheers, hope you can help.
Shan-Dysigns
5/20/2004 11:04:26 PM
What are you using fot hitTest? The cursor, another movie clip intersecting another movie clip?
kaliedo
5/20/2004 11:50:32 PM
one movie clip intersecting another

cheers
Shan-Dysigns
5/21/2004 12:03:10 AM
If you have two mc's, named mc1 and mc2. Whether you are dragging an mc or
whatever, add this to the code on one mc;

this.onEnterFrame=function() { // this example is to be placed on mc1 //
if (this.hitTest(mc2)) {
_root.somemovieclip._visible=false; // somemovieclip is the mc you want to
make invisible //
}
};

depending on how you have everything setup, you may have to change some of the
target paths.
kaliedo
5/21/2004 10:52:51 AM
hi there "shan"

this problem has been tormenting me for the last few days and your reply seems
to have sorted it out - so a massive thanks for taking the time and trouble.

I jigged your code in to fit with my target paths and ended up having to put
the if statement (i.e if this.hittest ...target path.......then _visible =
false comment ) on every back button on each scene and it seems to have done
the trick!

many thanks
kaliedo
AddThis Social Bookmark Button