Solved

Disable Mouse events AS2

Posted on 2009-04-12
6
3,906 Views
Last Modified: 2013-11-11
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
Comment
Question by:moshem
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 5

Expert Comment

by:john_hollings
ID: 24126973
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
 
LVL 1

Author Comment

by:moshem
ID: 24127035
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
 
LVL 5

Expert Comment

by:john_hollings
ID: 24131335
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!

 
LVL 1

Author Comment

by:moshem
ID: 24135401
no, sorry, this is the property of the client..
0
 
LVL 5

Accepted Solution

by:
john_hollings earned 500 total points
ID: 24136007
sure I understand.  

Try setting this value to false:

myMovieClipName.useHandCursor = false;
0
 
LVL 1

Author Comment

by:moshem
ID: 24136710
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
YouTube video issue 28 143
adobe flash plugin has crashed while listening to pandora 2 85
Some You tube not working in IE11 on Windows 10 and 8.1 5 117
type of website 13 51
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question