5 Replies Latest reply on Apr 3, 2009 8:51 AM by logeye

    Load Movie Help

    ierick
      I am pulling double duty with this question as it serves two purposes. I am developing a total flash controlled ad system for myself, but also need to use the same theory for a project for work.

      Concept:
      I have a main movie (ad rotator system) that I then want to randomly load other swf's (individual ads) into this main swf after a set period of time. The random load I got set no problem. The problem I am having is to get it to move to the new Frame label of the main movie which then loads the smaller swfs. I am using the LoadMovie with nInterval time delay command in flash to load the movies.

      Sample:
      stop();
      var nInterval = setInterval(Play, 1000);
      function Play() {
      clearInterval(nInterval);
      gotoAndPlay("_sc1");
      }

      Problem:
      Using the above code in both the main swf and individual swfs it will only load one movie (ad) then replay this one over and over, etc. When I take out this nInterval it loads each one randomly. I slowly learning aScript, and trying to move away from strictly timeline control, when I just need a simple pause of time.

      Does anyone have any idea? I have searched forums left and right, but to no avail; everything I find is nInterval. If there was an "unloadMovie" command I could make it happen, but can't find any documentation on this either.

      thanks.
      E
        • 1. Re: Load Movie Help
          ierick Level 1
          Addition below is the control for each random ad (swf):

          stop();

          onEnterFrame = function () {
          _root.loadMovie("adSWF/250x154/ecvm-a09_v1e.swf");
          };

          var timePause = setInterval(Play, 15000);

          function Play() {
          clearInterval(timePause);
          gotoAndPlay(random(5)+1);
          ad1_mc.unloadMovie();
          }

          (ad2_mc, ad3_mc.... etc.)
          Thanks.
          • 2. Re: Load Movie Help
            logeye Level 1
            There is an unloadMovie command.

            When in Flash with any FLA open (even a new empty one), if you select F9 on your keyboard this will open a new window called Actions. Type in unloadMovie just like it is written here. Place your mouse curson inside the word unloadMovie.
            In the upper right of the Actions window select the help button. This will open a new help window to the unloadMovie command.

            Hope this helps.
            • 3. Re: Load Movie Help
              ierick Level 1
              I used the unloadMovie command in the above code (2nd post), but doesn't seem to unload anything, any ideas?

              I have been thinking would it be better to create scenes versus frames in this situation, and randomly load each scene (if that is possible)?
              • 4. Re: Load Movie Help
                logeye Level 1
                HI ierick,

                If I understand correctly, this may help.

                Place the attached code in the first and only fram of your main movie.
                Can empty movieclip inside the main movie. Place it on the stage and give it an instance name of "target".

                The ad movies are named ad0.swf, ad1.swf, etc. and are in the same folder as the main swf file.

                Try adding the following code to the first frame and see if it helps.
                • 5. Re: Load Movie Help
                  logeye Level 1
                  Sorry pushed the wrong button.....
                  HI ierick,

                  If I understand correctly, this may help.

                  Place the attached code in the first and only fram of your main movie.
                  Can empty movieclip inside the main movie. Place it on the stage and give it an instance name of "target".

                  The ad movies are named ad0.swf, ad1.swf, etc. and are in the same folder as the main swf file.

                  Try adding the following code to the first frame and see if it helps.