1 Reply Latest reply on Mar 29, 2010 7:34 AM by kglad

    Load external swf

    auto_ghost Level 1
      /*
         #############################################################
         ##   Homepage                                              ##
         ##   - Choose from 3 random images                         ##
         #############################################################
      */
      
      // Attach random homepage image
      var rnd = Math.floor(Math.random() * (4 -1)) + 1;
      var homeimg = this.attachMovie("homeimg"+rnd, "background_mc", 1);
      _root.currentContentWidth = homeimg._width;
      _root.currentContentHeight = homeimg._height;
      _root.updatePositions();
      
      
      startContent = function() {
          // nothing to do
      };
      

       

      This is as I have for my homepage, but i'd like to load an external swf (lights.swf)

      Can anyone help on how to change the actionscript to do so?

       

      Thanks

        • 1. Re: Load external swf
          kglad Adobe Community Professional & MVP

          that code "attaches" a homepage image.  if you want to load a swf, you can use the movieclip loadMovie() method:

           

           

          // remove or comment-out your attachMovie() code

          this.createEmptyMovieClip("homeImageMC",this.getNextHighestDepth());

          this.homeImageMC.loadMovie("lights.swf");