Solved

Set Visibility of Movie Clip by Clicking Outside of It

Posted on 2003-10-24
4
267 Views
Last Modified: 2010-04-03
I have a Table of Contents Movie Clip which is launched on _level2 of my movie, using a button.

I use the following script on my button.

on (release) {
      if (_root.tableofcontents.active == 1) {
            setProperty("_root.tableofcontents", _visible, "1");
            _root.tableofcontents.active = "0";
      } else {
            _root.tableofcontents.active = "1";
            setProperty("_root.tableofcontents", _visible, "0");
      }
}

Is there a way I can have a user click anywhere outside of the visible Table of Contents, and have the visibility set to "0"?  I'd like to do this WITHOUT creating an invisible button 800 by 600 (the size of my movie).

Didn't know if there was some other way of doing it.

Thanks,
Brandon
0
Comment
Question by:brandonlee
[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
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 9617411
_visible has a boolean value so you use true or false with it
with _alpha use 0 to 100

so..
setProperty("_root.tableofcontents", _visible, "1");

should be..
setProperty("_root.tableofcontents", _visible, true);  

_visible will disable the target
_alpha will still allow a button to work..even though you cant see it.


With MX you can give a movieclip the actions of the button object by using the on handler..so on the  tableofcontents clip..

on(releaseOutside){
     level2._visible = false);
    _level2.active = 0; //so you can reactivate the menu if needed

}

Z
0
 
LVL 5

Accepted Solution

by:
Calron earned 125 total points
ID: 9620519
I have not been able to find any other way to do what you want to without using a big button. What you can do is change the mousecursor of the button so the user doesn't see the hand cursor while over your big button:

_root.hider.useHandCursor = false;   where _root.hider is my button (also a button that covers the whole frame in my case :)  )
0
 
LVL 5

Expert Comment

by:Calron
ID: 9620527
the on(releaseOutside){  will only work if the mouse was pressed inside of the movie clip and then release outside of it.
0
 

Author Comment

by:brandonlee
ID: 9626718
Thanks!  That's what I thought, but hiding the cursor will help a lot!

Thanks for your help!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

707 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