• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4008
  • Last Modified:

Disable Mouse events AS2

Hi,

I have an FLA that has some buttons on one layer.

upon clicking one of the buttons, a new layer is being displayed on top of the previous layer.

all is ok, except that the bottom layer, is still clickable...


I need it to stop receiving events and stop showing the hand cursor while the top layer exists and resume events when the top layer is closed.

I tried :

mc.enabled = false;
mc.mouseEnabled = false;
mc.mouseChildren = false;


nothing works....

the following did work, but, the mouse cursor is still the hand cursor, and this seem like an ugly solution, for something that seems to me like a very basic function...

one_mc.onRelease = one_mc_onRelease;

function one_mc_onRelease ()
{
      trace ("hi");
}

two_mc.onRelease = function ()
{
      one_mc.onRelease = null;
}



any ideas ?
0
moshem
Asked:
moshem
  • 3
  • 3
1 Solution
 
john_hollingsCommented:
You might have disabled it but I think you also have to hide it so try adding this:

Let's stay we have one_mc (the current movie) with one_btn within this movie.  When one_btn is clicked we want two_mc which has two_btn within it appear on top of one_mc.  But at the same  time we need one_mc to not be clickable and not have the pointer icon on it, try:

one_btn.onRelease = function() {
     //load two_mc code here
     
    //deactive one_btn
    one_btn.enabled = false;
    //hide one_btn
    one_btn._alpha = 0;
    //hide one_mc
    one_mc._alpha = 0;
}

Hope this helps.
0
 
moshemAuthor Commented:
Hi,

this is not a button, this is a movie clip.

also, I don't want to hide it, the concept is to have it below another layer, it should remain visible (maybe blurred) but not clickable.
0
 
john_hollingsCommented:
Sorry I misunderstood the questions.  Any chance of providing your fla file to see what's going on?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
moshemAuthor Commented:
no, sorry, this is the property of the client..
0
 
john_hollingsCommented:
sure I understand.  

Try setting this value to false:

myMovieClipName.useHandCursor = false;
0
 
moshemAuthor Commented:
nope, that didn't even make the cursor go away... maybe because the movieclip contains other movie clips which acts as buttons.

this however did work:

main_menu_mc.onRelease = null;

but I didn't find any way to retrieve the value of onRelease before setting it to null..

that is because I wanted to get it back working later on..
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now