3 Replies Latest reply on Sep 9, 2008 7:04 AM by ScottE

    Problems with externally loaded swf

    ScottE
      Hi All,

      I have a flash project that loads in an external swf file. I have simple actionscript 2 in the externally loaded swf that doesn't work in the main flash swf.

      The actionscript is simple:

      _root.classes1_mc._visible=false;
      stop();

      When they click a button then the actionscript is:
      _root.classes1_mc._visible=true;

      This works great in testing the external swf but when it's loaded into the main swf the actionscript doesn't work.

      Any ideas on why this is happening?

      Many Thanks,
      Scott
        • 1. Re: Problems with externally loaded swf
          robdillon Most Valuable Participant
          _root in the movie alone means the root level of that movie, when you load the movie into another, _root is now the root level of the base movie. Use _parent to move up each level.
          • 2. Re: Problems with externally loaded swf
            ScottE Level 1
            Hi,

            I tried using _parent but it doesn't work. I've changed the swf that I'm loading in to the main swf site. It have 2 frames. In frame 1 I simply have:
            stop();

            I have a frame label "s2" in the second frame.

            The button is in the swf I'm loading in and has the following actionscript:

            on (release) {
            _root.gotoAndPlay("s2");
            }

            If I use _parent.gotoAndPlay("s2") the swf I'm loading in doesn't work by itself or when it's loaded into the main swf.

            I'm not sure why this isn't working. Any ideas on how I can get this to work? This should be very simple and I'm perplexed as to why it isn't working.

            Your help is MUCH appreciated!

            Thanks,
            • 3. Re: Problems with externally loaded swf
              ScottE Level 1
              Okay I figured it out and will post the solution in case any one else has the same problem.

              You simply add the following actionscript to the first frame:

              _lockroot = true;