2 Replies Latest reply on Sep 19, 2006 6:14 PM by NSurveyor

    Load new swf & goto certain frame #

    DavisOne
      I have 4 swf files. each file has 4 or 5 frames in it. I have a button inside swf1 and when clicked I want to go from swf1 to swf3 or from 3 back to 1. That is no problem with unloadmovie() but the problem I am having is that I need to go to a certain frame. So when I go from swf1 - swf3 and within swf 3 I need to go to frame 3. That is where I'm having troubles. I can get the swf 3 to load but I can't get it to go to frame 3. Any help would be great. Thanks
        • 1. Re: Load new swf & goto certain frame #
          coldMiner Level 1
          actionscript in swf1:
          myButton.onRelease = function(){
          _root.loadMovie("swf2.swf");
          // this will never happen because this movie don't exist anymore:
          _root.gotoAndPlay(3);
          };

          can this be your problem?

          If so, then u have to create an empty movieclip, and load your swf there.
          And keep in mind that you can't control a movieclips timeline before the
          whole movieclip is loaded.
          • 2. Re: Load new swf & goto certain frame #
            NSurveyor Level 2
            Insted of using container.loadMovie("whatever.swf"), use: container.loadMovieF("whatever.swf",F); where F is the frame number you want the movie to go to on load. Place the following code before all of your other code:

            MovieClip.prototype.loadMovieF = function(url, frame) {
            var obj = {f:frame};
            var my_mcl = new MovieClipLoader();
            my_mcl.addListener(obj);
            obj.onLoadInit = function(targ:MovieClip) {
            targ.gotoAndStop(this.f);
            };
            my_mcl.loadClip(url, this);
            };