-
Making hitTest stop
Can anyone explain to me how to make a hitTest stop as soon as it returns TRUE. I am using the following code and everytime the hitTest returns TRUE it keeps going thereby stopping the [I]_root[Illustration] from playing past frame 2.
function iconHit () {
_root[icons[i]].onEnterFrame = function() {
if (_root[icons[i]].hitTest(_root[wtHit[i]])) {
trace(i);
setProperty(_root[icons[i]], _visible, false);
setProperty(_root[Illustration[i]], _visible, true);
_root[Illustration[i]].gotoAndPlay(2);
buttonsOn.call();
}
};
};
thanks
Flash 8 (PC)
Last edited by StateEgg; 02-15-2007 at 03:54 PM.
-
Code:
delete _root[icons[i]].onEnterFrame
gparis
-
Is there another option?
Is there a way to do this while keeping the onEnterFrame?
I need the onEnterFrame to keep everything looping and allowing the icon to constantly check for the "hit". I need a way to get out of the onEnterFrame loop once the first "hit" has been detected.
-
I need a way to get out of the onEnterFrame loop once the first "hit" has been detected.
the way you usually write that type of statement is:
if (condition has not been met) // do actions else delete the on.EnterFrame.
gparis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|