4 Replies Latest reply on Jun 12, 2006 7:07 PM by Newsgroup_User

    loadMovie question

    dante013 Level 1
      I have a .swf movie I am loading into a main movie. The .swf movie has two frame labels that I would like to call from the main movie, is it possible to have two buttons calling the different frame labels from the main movie?
        • 1. Re: loadMovie question
          Steven_Lyons
          Yes, but are you loading the swf into a level or a MovieClip?
          • 2. Re: loadMovie question
            dante013 Level 1
            I'm loading it into a movieClip
            • 3. Re: loadMovie question
              dante013 Level 1
              I'm thinking maybe I wasn't too clear on what I want to happen. Now, I know how to access the different frames once the movie has been loaded, but I'm wondering if I can call, say frame 50 from a movie that is being loaded for the first time?

              I have two buttons which loads the same .swf file.
              on(press) for button1 loads movie and plays frame 1.
              on(press) for button2 loads movie and plays frame 50. Is that possible? And I am loading it into a movieClip. Any help would be great, thanks!
              • 4. Re: loadMovie question
                Level 7
                Yes but you need to know when frame 50 was loaded.

                For that you can use MovieClipLoader.onLoadComplete
                http://livedocs.macromedia.com/flash/8/main/00002543.html. Once the
                onLoadComplete event handler is fired you can have target_mc.gotoAndPlay(50)
                or target_mc.gotoAndStop(50) depending on your needs. But you need to
                consider that the first 49 frames will play. So on
                MovieClipLoader.onLoadStart
                http://livedocs.macromedia.com/flash/8/main/00002547.html you can make the
                movie invisible or in the external movie have the first frame blank with a
                stop() action on it.

                var container_mc:MovieClip = this.createEmptyMovieClip("container_mc",
                this.getNextHighestDepth());

                var mclListener:Object = new Object();
                mclListener.onLoadStart = function(target_mc:MovieClip) {
                target_mc._visible = false;
                };
                mclListener.onLoadComplete = function(target_mc:MovieClip) {
                target_mc.gotoAndPlay(50);
                target_mc._visible = true;
                };
                var my_mcl:MovieClipLoader = new MovieClipLoader();
                my_mcl.addListener(mclListener);
                my_mcl.loadClip("yourmovie.swf", container_mc);

                If you cannot wait until the entire movie is loaded, you can use
                MovieClipLoader.onLoadProgress to detect when frame 50 is ready to play.
                var container_mc:MovieClip = this.createEmptyMovieClip("container_mc",
                this.getNextHighestDepth());

                var mclListener:Object = new Object();
                mclListener.onLoadStart = function(target_mc:MovieClip) {
                target_mc._visible = false;
                };
                mclListener.onLoadProgress = function(target_mc:MovieClip,
                bytesLoaded:Number, bytesTotal:Number):Void {
                if target_mc._framesloaded ==50)
                {
                target_mc.gotoAndPlay(50);
                target_mc._visible = true;
                }
                };
                var my_mcl:MovieClipLoader = new MovieClipLoader();
                my_mcl.addListener(mclListener);
                my_mcl.loadClip("yourmovie.swf", container_mc);

                --
                Lon Hosford
                www.lonhosford.com
                Flash, Actionscript and Flash Media Server examples:
                http://flashexamples.hosfordusa.com
                May many happy bits flow your way!
                "dante013" <webforumsuser@macromedia.com> wrote in message
                news:e6kcmr$m0v$1@forums.macromedia.com...
                > I'm thinking maybe I wasn't too clear on what I want to happen. Now, I
                > know
                > how to access the different frames once the movie has been loaded, but I'm
                > wondering if I can call, say frame 50 from a movie that is being loaded
                > for the
                > first time?
                >
                > I have two buttons which loads the same .swf file.
                > on(press) for button1 loads movie and plays frame 1.
                > on(press) for button2 loads movie and plays frame 50. Is that possible?
                > And I
                > am loading it into a movieClip. Any help would be great, thanks!
                >