A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: visible

  1. #1
    Member
    Join Date
    Dec 2000
    Posts
    55

    visible

    Hi,

    I have ten movie clips and ten buttons, I want to write a function so that if i click a button i need see a particular movie onlt rest clips are in visible. any help from masters

    thanks a lot

  2. #2
    Senior Member
    Join Date
    Feb 2002
    Posts
    536
    okay... lets try something here:

    Code:
    function showMC (clip) {
       for (i = 1; i <= 10; i++) _root["mc" + 1]._visible = false;
       _root[clip]._visible = true;
    }
    This function will hide all ten mcs (mc1, mc2 ... mc10) and will show only the mc 'clip'.

    to use that function:
    showMC("mc3");

    or

    showMC("mc1");


    where
    mc3 - mc1 are the clip instances.

    If u have different names, just replace them in the function. Also, this function will work for mcs in the main stage (_root).

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