1 Reply Latest reply on May 6, 2011 7:57 AM by juresti

    PAth not working

    juresti Level 1

      The code below is loaded into a clip movieHolder and I can not get it to work. It works on its own but not when loaded.

       

      holder_mc0.onRelease = function(){
          holder_mc0.stopDrag();
         
              if (this._droptarget == "/string02") {
              this..onTarget=true;
              string02.gotoAndStop(2);
             this._visible = false;
              menu_txt0._visible = false;
              zoom0._visible = false;
              main_txt1.setNewTextFormat(mainText);
              main_txt1.text = $parsedObject.tool[0].name
              trace(main_txt1);
      }else
      {
              _parent.onTarget=false;
          }}

       

       

       

      One movie loads another in movieHolder, then that swf loads the movie I'm trying to get to work by going back to the main movie using this code:

      function preloadContainer(){
         
          // get bytes loaded and total from container_mc
          var bytes_loaded = movieHolder.getBytesLoaded();
          var bytes_total = movieHolder.getBytesTotal();
         
         
          // stop and hide the movie so it wont play or
          // be seen while progressively downloading
          // (keep trying if it exists or not just to be sure)
          movieHolder.stop();
          movieHolder._visible = false;
         
          // if bytes_total is a valid number and greater than 0
          if (bytes_total > 0){
             
              // get percent loaded
              var percent_loaded = bytes_loaded/bytes_total;
             
              // update the value in the preloader
              preloader_mc.value = percent_loaded;
                 
              // check if preloading is complete
              if (percent_loaded == 1){
                 
                  // play and show the container clip
                  movieHolder.gotoAndStop(1);
                  movieHolder._visible = true;

       

                 
                  // remove the preloader movie clip
                  preloader_mc.removeMovieClip();
                 
                  // delete the onEnterFrame event handler running this function
                  delete onEnterFrame;
              }
          }
      }

        • 1. Re: PAth not working
          juresti Level 1

             I got it!!

           

          holder_mc0.onRelease = function(){
              holder_mc0.stopDrag();
                  if ((eval(this._droptarget) == string02)) {
                  this.onTarget=true;
                  string02.gotoAndStop(2);
                  this._visible = false;
                  menu_txt0._visible = false;
                  zoom0._visible = false;
                  main_txt1.setNewTextFormat(mainText);
                  main_txt1.text = $parsedObject.tool[0].name
                  trace("WT");
          }else
          {
                  this.onTarget=false;
              }}