Solved

Set Visibility of Movie Clip by Clicking Outside of It

Posted on 2003-10-24
4
233 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AWAY 3d Using BitMapCubeTexture 1 402
Array is not working ( AS2 ) 4 146
Firefox fullscreen video lags 4 155
bandwidth 5 67
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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…
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 use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

867 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now