?
Solved

Set Visibility of Movie Clip by Clicking Outside of It

Posted on 2003-10-24
4
Medium Priority
?
271 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

765 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