3 Replies Latest reply on Dec 15, 2007 9:20 AM by exPluda?

    Controlling SWF from another SWF

    med23
      Here is the problem. This is done in Flash 8.

      I have a main SWF that has a movieclip on the stage that I have given an instance name to.

      This movieclip is the site's navigation bar. Within this movieclip there are buttons. Also, there are markers on different frames that the buttons will make the timeline go to on(release). Upon entering those markered frames, the actionscript on those frames loads another SWF into the main SWF's stage.

      So, my question is regarding controlling the main SWF's movieclip (which contains the navigation) with a button that is in the other loaded SWF.

      Here is the link so you can see what I'm talking about. www.sq2d.com/codygatesite/

      On the "About" section, the text button "See our portfolio companies >" at the bottom should go into the main SWF, then into the navigation movieclip, and jump to the appropriate markered frame. Below is the actionscript that I was applying to the button.


      on (release) {
      _root.navigation.gotoAndPlay ("portfolio");
      }


      THANKS so much for any help!!!
        • 1. Re: Controlling SWF from another SWF
          exPluda? Level 1
          not sure abaut that one, but I think you should use

          on (release) {
          this._parent.navigation.gotoAndPlay ("portfolio");
          }

          or just

          on (release) {
          _parent.navigation.gotoAndPlay ("portfolio");
          }
          • 2. Controlling SWF from another SWF
            med23 Level 1
            Thanks for the reply!

            Unfotunately, it didn't work. That would work to control something in the parent timeline of the same SWF, but I am trying to get this button to control the timeline of the SWF this button's SWF is loaded into . So this SWF is nested in another SWF which has the navigation mc in it. I need to get this button to control that navigation mc. I hope I am being clear enough.

            AGAIN, THANKS FOR HELPING! I appreciate it greatly!
            • 3. Re: Controlling SWF from another SWF
              exPluda? Level 1
              Hello,

              make this small test, create one new fla and in main timeline add this script

              _root.createEmptyMovieClip("loader", _root.getNextHighestDepth());
              _root.loader.onEnterFrame = function() {
              this.loadMovie("swf_2.swf", this.getNextHighestDepth());
              }
              //
              stop();

              in frame 25 add this code

              trace("I'm now in frame 25");

              now create another fla and save it as swf_2.fla

              place in stage one movieclip with instance name = bt

              in timeline add this script

              bt.onRelease = function() {
              _root.gotoAndStop(25);
              }

              publish both and see if it works, you should be able of controling your main timeline using the button on your 2nd swf