5 Replies Latest reply on Apr 18, 2006 5:35 AM by blemmo

    jumping to a scene in an external swf

    ucanwinu
      hi

      i have two fla files that i want to link together. say part_1.swf and part_ 2.swf

      from part_2.swf i want to have a button that take me to a particular scene of part_1.swf

      i use loadmovie on level 0 so that when it jumps to part 1 it completely replace the part2.swf. but my problem is that i want to reach a particular scene in part_1.swf

      how can i achieve that. any help is appreciated.

      thanks n regards

      sandy
        • 1. Re: jumping to a scene in an external swf
          blemmo Level 1
          Hi,

          you'll need some kind of preloader code, that checks the loading progress of part_1.swf, and if it's completely loaded, executes the gotoAndPlay("Scene X",1) command. This is difficult to do if you load into _level0, because that means that everything in the player gets replaced by the loaded movie, including an MC used for checking load progress. Maybe it's possible with the MovieClipLoader class, this provides events that get executed when the loading is complete, so you could place the goto command in that event. I'm not sure if the MCL object will also be replaced by the loaded movie, but I think it might work, just give it try.

          hth,
          blemmo
          • 2. Re: jumping to a scene in an external swf
            ucanwinu Level 1
            hi blemmo

            thanks for ur help. but actually preloading is not a problem. its a presentation that will be delivered on a CD ROM so preloading is not an issue. my only problem is that i want to know a code that will let me jump from one swf to another swf's particular scene. some code on a button like

            on release

            loadmovie part_1.swf, scenename

            is it possible to go to a particular scene of a different swf by pressing a button
            • 3. Re: jumping to a scene in an external swf
              amithjnt
              Hey Sandy
              I m having the same problem.
              but i dont want to jump in another scene of file. i just want to jump on particular frame of another swf file. Like i want to go to 10th frame of that swf file.
              I think our problem is same. If u think its different then plz reply n even u get ur answer plz tell me too. I will be thankful to u. Coz i really need it....

              I hv used

              on(press){
              loadMovieNum("abc.swf",2);
              _level2.gotoAndPlay(10);
              }

              check if it's useful to u. but its nt working with my file.....

              Alok
              alokmp2003@yahoo.com
              • 4. Re: jumping to a scene in an external swf
                blemmo Level 1
                Sorry, but afaik this isn't possible. If you want to jump to a scene, you have to use the global gotoAndPlay method. This will always take the _root MC to the specified scene, so you can't use it from another swf.
                Scenes aren't very popular, it's often better to use frame labels instead of scenes. In your case there's the additional issue that you want to load into _level0, which means everything gets replaced, even variables that could sign the loaded clip what to play. I think it's only possible with the MCL class, not because you need preloading code, but to define an action that gets executed when the movie is loaded. When it's loaded, you can use the global gotoAndPlay, but not before that, because it won't address the right movie.
                But as said before, it may be that the MCL object also gets replaced by the loaded movie, so I'm not sure if that helps. Maybe you could simply try it; I can't give a better suggestion than that (except of not using scenes but frame labels).

                cheers,
                blemmo
                • 5. Re: jumping to a scene in an external swf
                  blemmo Level 1
                  amithjnt,

                  most likely frame 10 isn't loaded yet when the gotoAndPlay executes. Use some kind of preloader to check if it's loaded, and gotoAndPlay if it is.