A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Thanks to all who helped me the other day with a basic button toggle action. Got it to work just fine. Now building on top of that...

    I want to be able to toggle (hide and show) multiple movie clips from a single button, with the toggle action affecting whichever movie clip is visible at the time (they each appear in the same position, one at a time). I've done some trial and error with if...else, but can't get it to work predictably. I'm thinking that maybe loading each movie clip into the same level when I call for it (replacing whatever was loaded before) might allow me to apply the toggle action to that level (whatever is loaded). But I need to start the main timeline with the first movie clip already loaded into that level. Haven't found reference material to tell me how to do this. Does it sound to you actionscript gurus out there that I'm on the right track?

    Thanks in advance for your help, as always!

    Dale Janzen
    http://www.degajegroup.com

  2. #2
    if you know which mc's you want to toggle...this should toggle them fine

    if (mc._visible==true)
    mc._visible=false;
    else if (ms._visible==false)
    mc._visible=true;

    that'll toggle one specific mc, depending on how you order your mc's...i cant really help u with getting multiple mc's to show/hide. two obvious approaches can be doing a for loop, or keeping track of the mc's names u want to toggle in an array or something and then going thru the array and toggling the visibility.

  3. #3

    Thanks!

    Thank you Feji! I took your script and tweaked around with it and got EXACTLY what I wanted. My approach would have yielded WAY more coding ang bloat. The lesson I'm learning here is to break things down into their simplest functions, then code to make the functions work. Build one on top of the other. I know that there will always be exceptions to this way of working, but as I learn actionscripting, more often than not I find it works for me.

    A BIG thanks again! Looking forward to the point where I can make a few helpful suggestions too.

    Dale Janzen
    http://www.degajegroup.com

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