Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorrzea
    • CommentTimeAug 12th 2008 edited
     permalink
    Hello all,

    My Case:
    I have a US Map and several states are clickable, when you rollover a state it changes from yellow to red (this is a MC). When you click a state it stays red and a box 'drops down' from it with a body text explaining something about it (this is another separate MC). The box can be close in two ways: 1. By clicking on the state again. Or 2. By clicking on an X that the box has.

    My problem:
    I can't find a way to close the box via the X.

    The Explanation:
    The box with the text and the X are all a Movie Clip, this MC is activated by clicking on the state on the main Time Line, but I don't know how to make the X close the MC it's contained in (the drop down box). I can close the box from outside (main Time Line) by clicking the state though.

    Does that make sense?

    You have to consider that the X ' wouldn't ' know when the box is contained in is either open or closed... which is actually the piece of ActionScript that I need.

    The code I'm using:
    This is the code I'm using on the state to open and close the box containing the explanatory text, and the closing X of course:
    [indent]
    on (release) {
    if (Number(test) == 1) {
    test = 0;
    } else {
    test = 1;
    }
    }
    [/indent]

    My problem:
    As I mentioned, I don't know how to use the above code and use it inside a MC to make the box close itself if it's open... the X to close the box can only be seen when the box is open or has dropped down.

    Can anyone give me a hand please?

    Download the FLA:
    To understand better my problem you can download the original file from here: http://www.ricardozea.net/map/map.zip

    Any help will be greatly appreciated.

    Thank you!
    • CommentAuthorrzea
    • CommentTimeAug 12th 2008
     permalink
    I have resolved my problem.

    All I had to do was to add "_root." to the code and place it on the X that closed the box.

    This is the code:

    on (release) {
    if (Number(_root.test) == 1) {
    _root.test = 0;
    } else {
    _root.test = 1;
    }
    }
Add your comments
    Username Password
  • Format comments as (Help)