4 Replies Latest reply on Jun 28, 2006 9:55 PM by kglad

    loadMovie - gotoAndStop Help

    LDOUBLEU
      Hello,

      I have a movie with buttons. and when i click a button, it loads another movie and I want it to go to a specific frame - Frame 2 for example, and stop.

      Any help would be great! Thanks

      Here's an example of the AS on the button:

        • 1. Re: loadMovie - gotoAndStop Help
          kglad Adobe Community Professional & MVP
          yuo must wait until loading is complete before issuing your goto statement. use preloader code or the onLoadInit() method of the moviecliploader class.
          • 2. Re: loadMovie - gotoAndStop Help
            Level 7
            You need a mechanism to know when the loaded movie is ready to goto the
            frame you want. Flash movies are downloaded progressively after you issue
            loadMovie and does not provide a means to know what part of the movie is
            available for access or any of it on the following line.

            You can use MovieClipLoader as a means and in the onLoadComplete method is a
            potential place to begin code addressing the loaded movie:
            http://livedocs.macromedia.com/flash/8/main/00002543.html

            taking the example from the docs

            loadListener.onLoadComplete = function(target_mc:MovieClip,
            httpStatus:Number):Void {
            trace(">> loadListener.onLoadComplete()");
            trace(">> =============================");
            trace(">> target_mc._width: " + target_mc._width); // 0
            trace(">> httpStatus: " + httpStatus);

            target_mc.gotoAndPlay(5);


            }




            --
            Lon Hosford
            www.lonhosford.com
            Flash, Actionscript and Flash Media Server examples:
            http://flashexamples.hosfordusa.com
            May many happy bits flow your way!
            "LDOUBLEU" <webforumsuser@macromedia.com> wrote in message
            news:e7udd8$l5l$1@forums.macromedia.com...
            > Hello,
            >
            > I have a movie with buttons. and when i click a button, it loads another
            > movie
            > and I want it to go to a specific frame - Frame 2 for example, and stop.
            >
            > Any help would be great! Thanks
            >
            > Here's an example of the AS on the button:
            >
            >
            >
            > button5.onRollOver = function () {
            > changeOptionColor(this, overColor);
            > }
            > button5.onRollOut = function () {
            > changeOptionColor(this, outColor);
            > }
            > button5.onRelease = function () {
            > reActivateBtns();
            > this.enabled = false;
            > changeOptionColor(this, overColor);
            > container.loadMovie("clipart_1.swf", 5);
            > }
            >


            • 3. Re: loadMovie - gotoAndStop Help
              LDOUBLEU Level 1
              Thanks to the both of you. I appreciate it! Got it working.
              • 4. Re: loadMovie - gotoAndStop Help
                kglad Adobe Community Professional & MVP
                you're welcome.