|
-
OK, that worked great! Thank you
I'm wondering if I could run by what I understand this script to be saying and could you tell me if im right or not. I'm still new to this so Im interested to know.
onClipEvent (load) {
for (var i = 0; i<=5; i++) {
_root["fly_"+i].splat = false;
}
setting a all the flys booleen to false.
for (var i = 0; i<=5; i++) {
if (_root.fly_swatter.mesh.hitTest(_root["fly_"+i]) && _root["fly_"+i].splat == false) {
_root.fly_swatter.gotoAndPlay("swat");
_root["fly_"+i].splat = true;
_root["fly_"+i].fly2.gotoAndStop("splat");
we are now watching the flys and waiting to the IF condition to be met. The condition is IF the swatter is on a fly AND if the fly's booleen is false (meaning it hasn't been squashed) then swat the fly, change its booleen to true so that it can no longer trigger the animation and stop the playhead on the sqwashed fly anim.
Thanks so much. I think I learnt something new here.
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
|