View Full Version : make circle appear on mouse click

08-01-2009, 12:11 PM

I'm trying to make a simple 'spot the difference' game and would like a red circle (on its own layer in the attached fla) to appear around a specified area of the picture when the (invisble) button is clicked.

What is the action to make this happen? Also, is it possible to prevent the cursor from becoming a hand when hovering over the button, so the user must click on it in order to find out where it is?

Many thanks for help in advance :)

[Couldn't attach fla - it's here http://www.megaupload.com/?d=0LNQD3FU]

08-01-2009, 01:19 PM
-Not Solved-

Hello Noobug

I am also new to ActionScripting myself, but just to make it easier for the 'experts' to be able to understand you, I have the following queries:

Just to clarify. You want to disable the mouse 'hand' if the mouse literally roll(s)Over the 'button', yes? If this is so, then I am guessing a Variable to be added in the ActionScript timeline.

would like a red circle (on its own layer in the attached fla) to appear around a specified area of the picture
Masking technique should satisfy this desire of yours (if I have understood you right).

08-01-2009, 01:21 PM
This should help you out a bit:

package {

import flash.display.*;
import flash.events.*;

public class FlashTest extends Sprite {

private var buttonOne:Sprite = new Sprite();
private var buttonTwo:Sprite = new Sprite();
private var radius:int = 50;
private var buttonSpacing:int = 200;

public function FlashTest(colorOne:uint=0x330044,colorTwo:uint=0x6 60066) {

buttonOne.visible = false;

buttonTwo.x+= buttonSpacing;

buttonOne.addEventListener(MouseEvent.CLICK, oneClicked)
buttonTwo.addEventListener(MouseEvent.CLICK, twoClicked);

private function oneClicked(e:MouseEvent):void {

buttonOne.visible = false;

private function twoClicked(e:MouseEvent):void {

buttonOne.visible = true;

08-03-2009, 11:58 AM
Hi guys,

Many thanks for your help... Unfortunately I don't really understand your advice! Sorry, but I really am new to this!

What exactly does the below code do and where is it supposed to go? I presume it will disable the hand, so tried putting it on the button and ended up with lots of errors...

Just to clarify: what I really want to do is

a) for circles to appear on designated places [around the differences in a spot the difference game] when buttons are clicked - this is most important for me


b) if possible, for the cursor to remain a cursor, not turn into a hand, but for the user to still be able to click the button - although this might not be possible.

I really appreciate the help - sorry it's taking me so long to understand!! :)

08-03-2009, 01:20 PM
Click on your invisible button (assuming you already made it) and right click it and edit. In the frame panel you can put a couple key frames there and label them _up and _over.

On your _over frame you can have your red circle appear or play depending on if its just a graphic or animated clip - I'm not sure which one you have. You can also just do a quick visible = true/false

I know that the adobe website has a couple of tutorials on this, you could go and search button tutorials if you want to have a look.

08-03-2009, 03:50 PM
Thanks a lot Chichi... but I'm still struggling!

If I put the red circle in the button itself, ie place it on the 'down' state, how do I make it actually come up and stay on the stage? Do I need to put in some code?

I have attached a simple fla exaplining what I'm trying to achieve... So that when you click the button, the red circle (currently on the stage on its own layer) will appear and stay... I have made it into a movie clip but don't know what else I should do.

Again any help much much appreciated and sorry to keep asking on such a simple matter :)