5 Replies Latest reply on Mar 21, 2007 5:56 AM by maith

    Button in loaded swf not going to frame

    maith
      Hello,
      I have a button in SWF B. I have loaded SWF B into SWF A. Then when I press the button, in SWF B it will not goto Frame 1 of SWF A.

      The code I have on Frame3 of SWF A.fla is:

      I have tried using _root and _parent but doesn't work. I have tried adding the button code to SWFB too.
      Regards,
      Paul
        • 1. Re: Button in loaded swf not going to frame
          mclem Level 1
          try doing some traces on the button like trace(this._parent._parent) or try using _level0 instead of root. you could also try using the xray tool found here it will allow you to drill down to see the levels of all the files and figure out where that button is, it's a really great troubleshooting tool.
          • 2. Re: Button in loaded swf not going to frame
            maith Level 1
            Hi,
            Thanks for your reply. I have used _parent and _root and _level0 ,with trace statements, in the button, but the problem is, that the trace statement is not executed.

            Paul
            • 3. Re: Button in loaded swf not going to frame
              mclem Level 1
              in flash go to file and publish settings. in the publish settings window select the flash tab and make sure the "omit trace actions" check box is NOT checked. If you still have no trace output in the output window then your code is really not executing which is a whole different issue entirely. It either means the code is not on the button or there is an error in the code causing it to not execute or something else.

              also make sure your button does not exist on a frame that has key frames in it because if there is a key frame then technically there are now two instances of the button and you may be sitting on a frame with the second instance of the button that has no code on it.

              it's hard to tell with out seeing the file.

              let me know if the omit trace actions check box was selected if not post up the code for your button.
              • 4. Re: Button in loaded swf not going to frame
                Charles Parcell Level 1
                Does mclListener even exist?

                Have you been able to trace out from the onLoadInit function at all?
                • 5. Button in loaded swf not going to frame
                  maith Level 1
                  Thanks for your help.
                  The the "omit trace actions" check box iwas NOT checked.
                  I have solved the problem (after alot of code changing) It was simply. I added the following code on the button in the SWFB file:
                  on (release) {
                  _root.gotoAndStop(1);
                  }

                  Then on Frame 1 of SWFA file, I added the following code to unload the SWFB file.

                  this.createEmptyMovieClip("image_mc", 100);
                  var image_mcl:MovieClipLoader = new MovieClipLoader();
                  image_mcl.addListener(mclListener);
                  image_mcl.unloadClip("SWFB.swf", image_mc);

                  Thanks again,
                  Paul