dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: removing MC from the main scene

  1. #1
    Member
    Join Date
    May 2001
    Posts
    34
    l made 5 buttons and l put them on the main scene and l made 5 movies clips, now l put the movie on the stage and they should work like this if l click on one of the buttons one of them should works the other should be hidden ! And the problem that they are covering each other how could make them work correctly?

  2. #2
    Senior Member Jaffasoft's Avatar
    Join Date
    Apr 2001
    Location
    On Travel
    Posts
    1,587
    Use a for code put a ,' for' code on each button.

    //Button 1 to play mc1 and hide the others.

    on (press) {
    for (i = 1; i<=6; i++) {
    _root["mc"+i]._visible=0;
    _root.mc1._visible=1;
    _root.mc1.play();}}

    //Button 2 to play mc2 and hide others.

    on (press) {
    for (i = 1; i<=6; i++) {
    _root["mc"+i]._visible=0;
    _root.mc2._visible=1;
    _root.mc2.play();}}

    //Name your mc's on the main timeline. Mc1,mc2,mc3,mc4,mc5.

  3. #3
    Senior Member
    Join Date
    Jan 2002
    Posts
    121
    Jaffasoft

    can he be able to use tellTarget instead
    the code will be
    on (release) {
    tellTarget (_root.mc1) {
    gotoAndPlay (30);
    }
    }


    if it is true. will it be the easy way?

    thanks



  4. #4
    Senior Member Jaffasoft's Avatar
    Join Date
    Apr 2001
    Location
    On Travel
    Posts
    1,587
    I'm Sorry I cant really comment alostorah i don't know anything about telltarget probably because its depreciated and therefor i havent given any attention to learning how to use it.

    However I thought he could do it this way as well which would probably be easier and shorter on code.

    //Button 1 to bring mc1 to front.

    on (press,release) {
    _root.mc1.swapDepths(_root.depth++);
    _root.mc1.gotoAndPlay(30);
    }

    //Button 2 to bring mc2 to front.

    on (press,release) {
    _root.mc2.swapDepths(_root.depth++);
    _root.mc2.gotoAndPlay(30);
    }



  5. #5
    Senior Member
    Join Date
    Jan 2002
    Posts
    121
    thank you for your help
    actually i posted my reply
    to learn more about action script
    thank you

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