A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Enable and dissable buttons...agggg

  1. #1
    Junior Member
    Join Date
    Aug 2006
    Posts
    2

    Enable and dissable buttons...agggg

    All right, so everybody be patient with me. I am really trying my best with this. Here is the case:

    I have a movie with four MovieClips. Each mc has inside a button, so the movieclips function as buttons. Every time I click a movieclip (through the button inside), it loads a movie inside an invisible movieclip (this is not so important).

    Now, everytime I click a button, I want this button to dimm and get inactive. And when I click a different button, this is the one that gets inactive and the old one activates.

    So this is what I am trying to do so far, and what I have done is the following:

    1. I have a layer on top with all the mc named (blue_mc, red_mc, green_mc, orange_mc)

    2. I have another layer behind with the same mc but with a dark tint to make them look dimmed (deadblue_mc, deadred_mc, deadgreen_mc, deadorange_mc)

    3. The Script in my first frame of main movie (I copied the idea from a tutorial somewhere:

    stop();
    // dead buttons are on the layer beneath live buttons
    // the dead buttons are dimmed and disabled
    // same button symbols as the live buttons
    _root.deadblue_mc.deadblue_btn.enabled = false;
    _root.deadred_mc.deadred_btn.enabled = false;
    _root.deadgreen_mc.deadgreen_btn.enabled = false;
    _root.deadorange_mc.deadorange_btn.enabled = false;
    // restore all live buttons
    function allClips() {
    blue_mc._visible = true;
    red_mc._visible = true;
    green_mc._visible = true;
    orange_mc._visible = true;
    }


    4. Each moviclip has this action on its button:
    on (release) {
    allClips();
    _root.blue_mc._visible = false;
    _root.gotoAndStop("blue");
    }

    The visibility works perfect, but the function allClips() doesn't seem to work, the rest of the clips stay invisible.

    What am I doing wrong??

    Thanks guys
    --------------

  2. #2
    Member
    Join Date
    Jun 2006
    Location
    Leeds UK
    Posts
    84
    I think because you have action script attached to your button (note:not a good practice to attach AS to objects) instead of a frame you gonna need to have _root.allClips(); so try this first, if you attach your file I might be able to help you better.

    Good Luck

  3. #3
    Junior Member
    Join Date
    Aug 2006
    Posts
    2
    The _root did it, but now I am really puzzled and concerned over my practice to attach AS to objects

    Thanks so much. A private message will be coming to you soon.

    Cheers.

  4. #4
    Member
    Join Date
    Jun 2006
    Location
    Leeds UK
    Posts
    84
    Quote Originally Posted by Escorial
    The _root did it, but now I am really puzzled and concerned over my practice to attach AS to objects
    Glad it worked for you, about your AS I recommend to read this 6 pages of article it really teaches a lot!!

    ActionScript 2.0 Best Practices

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center