Solved

Set Visibility of Movie Clip by Clicking Outside of It

Posted on 2003-10-24
4
223 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
Comment Utility
_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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks!  That's what I thought, but hiding the cursor will help a lot!

Thanks for your help!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
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 how to load their YouTube profile onto Flash Media Live Encoder.

744 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

15 Experts available now in Live!

Get 1:1 Help Now