Quantcast
Channel: Adobe Community : All Content - All Communities
Viewing all articles
Browse latest Browse all 290743

Whack-A-Mole Questions

$
0
0

Hello Everybody

I have a question on the timing and detecting mouseClick in Actionscript. I have this simple game of Whack a Mole. 

 

My first problem is when I needed to addChild and removeChild a few seconds later. In a human way of saying, I want my animation of moleComingOut to be added to stage and wait for one second, after that second has passed, I want the remove the animation of the moleComingOut and add the animation of moleGoingDown to stage. After it finishes running the clip, I want it removedChild off the stage.  The problem is that I don't know how to let it pass 1 second and remove itself while adding the moleGoingDown, and remove the moleGoingDown when it finishes running.  The elements moleComingOut and moleGoingDown are movieclips that I have in my library. Thank you!

 

My second problem is on detecting mouse being clicked. Is there any way of detecting mouse being clicked? I want it so that (from the above question) when the moleComingOut is waiting for 1 second, detect any mouse being clicked on the mole, and display a moleHit animation, and remove itself. Is there any way of doing this? I know that in Java you can do it in a if/else statement but how about ActionScript? Thanks!

 

I can post my code up if needed. Thank you for taking time on my question! I appreciate it very much!

 

--

Maxwell


Viewing all articles
Browse latest Browse all 290743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>