2 Replies Latest reply on May 23, 2011 12:57 AM by sbusig

    Looking for some additional button help.....

    sbusig

      this.createEmptyMovieClip("containerLogoL",this.getNextHighestDepth());

       

      containerLogoL.attachMovie("logoLarge","logoLarge_mc",containerLogoL.getNextHighestDepth() );
      containerLogoL.logoLarge_mc._x = 770;
      containerLogoL.logoLarge_mc._y = 770;

       

      The above code places a logo on the stage. When I release a button I need that logo to unload. I have tried:

       

      on (release) {
      clearInterval(_global.myInterval);
      _root.containerProj.unloadMovie("main.swf");
      this.removeMovieClip("containerLogoL");
      _root.gotoAndStop(5);
      }

       

      I am also having issues with the logo loading a second time when I click a separate button that takes me back to frame 1 with the code that creates the empty movie clip.

       

      Any help would be appreciated.

        • 1. Re: Looking for some additional button help.....
          Ned Murphy Adobe Community Professional & MVP

          Try the following...

           

          var prohibit;

           

          if(!prohibit){

             this.createEmptyMovieClip("containerLogoL",this.getNextHighestDepth()) ;

           

             containerLogoL.attachMovie("logoLarge","logoLarge_mc",containerLogoL.g etNextHighestDepth());
             containerLogoL.logoLarge_mc._x = 770;
             containerLogoL.logoLarge_mc._y = 770;

           

             prohibit = true;

          }

           

           

           

          on (release) {
             clearInterval(_global.myInterval);
             _root.containerProj.unloadMovie("main.swf");
             removeMovieClip(containerLogoL);
             _root.gotoAndStop(5);
          }

          1 person found this helpful
          • 2. Re: Looking for some additional button help.....
            sbusig Level 1

            Ned,

             

            On my way but still having a problem with the button issue.

             

             

            //////This was the solution for the duplicating movie clips:

             

             

            stop();

            clearInterval(_global.myInterval);

            var prohibit;


            this.createEmptyMovieClip("containerProj",this.getNextHighestDepth());
            containerProj.loadMovie("main.swf")

            if(!prohibit){
            this.createEmptyMovieClip("containerBtn",this.getNextHighestDepth());
            this.createEmptyMovieClip("containerLogoL",this.getNextHighestDepth());
            this.createEmptyMovieClip("containerLogoS",this.getNextHighestDepth());


            containerBtn.attachMovie("mainBtns","mainBtns_mc",containerBtn.getNextHighestDepth());
            containerBtn.mainBtns_mc._x = 10;
            containerBtn.mainBtns_mc._y = 110;
            containerLogoL.attachMovie("logoLarge","logoLarge_mc",containerLogoL.getNextHighestDepth() );
            containerLogoL.logoLarge_mc._x = 770;
            containerLogoL.logoLarge_mc._y = 770;
            containerLogoS.attachMovie("logoSmall","logoSmall_mc",containerLogoS.getNextHighestDepth() );
            containerLogoS.logoSmall_mc._x = 10;
            containerLogoS.logoSmall_mc._y = 72;

            prohibit=true;
            }

             

            /////////This button should unload the movie clip:

             

            on (release) {
            clearInterval(_global.myInterval);
            _root.containerProj.unloadMovie("main.swf");
            containerLogoL.removeMovieClip("logoLarge_mc");
            _root.gotoAndStop(5);
            }

             

            //////And this should take me full circle to the first group of code that verifies what has been loaded.

            on(release){
            _root.gotoAndStop(1);
            }

             

            ///////For some reason the logoLarge_mc will not unload with:

             

            on (release) {
            clearInterval(_global.myInterval);
            _root.containerProj.unloadMovie("main.swf");
            removeMovieClip(containerLogoL);
            _root.gotoAndStop(5);
            }

             

            /////But it will with:

             

            on (release) {
            clearInterval(_global.myInterval);
            _root.containerProj.unloadMovie("main.swf");
            _root.containerLogoL.removeMovieClip("logoLarge_mc");
            _root.gotoAndStop(5);
            }

             

            /////Is with the code directly above is that the logo will not reload when returning to frame 1. I tried to add an else statement to the if but that just resulted in duplicate movieclips once again.

             

            Thanks much for the input.