I can't find a tutorial for this.

2007-10-30 18:26:16 by supercomputer276

My WarioWare flash game (working title: WarioWare Demo) is coming along fairly nicely. I've managed to create five fully working microgames, but I have a little trouble with the sixth game that I'm hoping someone can help me with.

Microgame description: The scene is the middle of a desert with a small city in the background. An atomic bomb drops, lands on the ground, shakes, and explodes. The player must get the mouse out of the frame before the bomb explodes to win.

The problem: I don't know how to tell the game how to check to see if the mouse is in the frame. I've tried several of the Newgrounds tutorials to no avail and attempting to get the code from games that have such tasks such as the Impossible Quizzes just drives me crazy. So can someone tell me what ActionScript I need to determine whether or not the mouse is in the frame when the bomb explodes?

I can't find a tutorial for this.


You must be logged in to comment on this post.


2007-10-30 18:36:50

i hate that gif. it's very annoying.


2007-10-30 18:41:29

Well i'm no expert at flash and actionscript, but to my knowledge the flash application cannot detect whether a mouse goes off the window or not. Because when you take your mouse away from the window it just assumes the mouse is still in the last recorded position in the window. A good way to visually show this is by using a custom cursor.

However, you could make a script that detects if the mouse is right on the edges of the scree, like a few pixels away from the borders of the application. This surely should have the same effect as it being off-window.

But mabye i'm wrong; just trying to help.


2007-10-30 19:21:26

To solve billybob3's problem: I'm DEFINITELY no expert, i'm horrible at flash, but its probably possible to create a rectangle INSIDE the actual flash window that the mouse could go out of.


2007-10-30 20:08:12

lol, it's funny.
People are telling you, you need a code but they don't tell you.

....Well I guess this is one of those comments.....
I know nothing about actionscript!
I wish I could help