A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: enable/disable all buttons in a movieclip

  1. #1
    Junior Member
    Join Date
    Jun 2005
    Location
    England
    Posts
    26

    enable/disable all buttons in a movieclip

    Hi there,

    I have a movieclip that contains a number of buttons. I want to be able to disable/enable all the buttons within the movieclip using actionscript, however I would rather not have to go through each button with the following code:

    my_movieclip.button1.enabled = true;
    my_movieclip.button2.enabled = true;
    etc.

    Does anyone know of a way to disable/enable all the buttons in a movieclip?

    Cheers,

    Bob
    www.bobcooper.org.uk

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try using a loop -
    Code:
    for(var b=1; b<10; b++){
    my_movieclip["button"+b].enabled = true;
    // button1, button2, .... button9
    }

  3. #3
    Junior Member
    Join Date
    Jun 2005
    Location
    England
    Posts
    26
    Thanks for that! That works great, this is gonna save so much coding!

    Bob
    www.bobcooper.org.uk

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