A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] catch all AS2 code for buttons enabled?

  1. #1
    Eternal Newbie
    Join Date
    Apr 2006
    Location
    Bitter cold Hell of the crappy NW
    Posts
    392

    [F8] catch all AS2 code for buttons enabled?

    I searched around and didn't find much to help me, but I have a (hopefully) quick question.

    In my application I have many many MCs acting as buttons, and they are all over, some are inside other MCs some are not. Most are set to _alpha = 0; and when parent MC is clicked on they tween to _alpha = 100;

    Everything works perfect and I love it all so much, HOWEVER, because the buttons are _alpha they are still clickable where they rest.

    I was wondering if there was a catch all code I could use to disable them unless alpha was 100. Something I could put in the AS file once for all buttons, perhaps?

    I was thinking along the lines of:

    Code:
    if (_alpha <=99){
        buttons.enabled = false;
    }
    else if (_alpha == 100){
       buttons.enabled = true;
    }
    but I can't think of a way to add that once and have it control ALL buttons that _alpha is less than 100.

    Is there a way?

    Thanks,

    ~MoN
    If I am wrong, please just correct me and move on.. there is no need for all that pointing and laughing! ~MoN

  2. #2
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    instead of making _alpha=0, make it _visible=false

  3. #3
    Eternal Newbie
    Join Date
    Apr 2006
    Location
    Bitter cold Hell of the crappy NW
    Posts
    392
    Thanks for that, I did try that a few times, I guess I just can't get the as file code right. I will keep trying though!
    If I am wrong, please just correct me and move on.. there is no need for all that pointing and laughing! ~MoN

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