2 Replies Latest reply on Sep 21, 2011 11:48 PM by SoloXX007

    Help! How to make external SWF's fit inside a container

    SoloXX007

      Hey all,

       

      Need a little nudge again. I'm creating a master movie that will load 4 external swf's. To do this, I made a container of sorts by having an animated screen rising up. I created an empty movie clip and titled it "empty_mc". I dragged it onto the "container screen" but when I press any specific button to load one of the external swf's, they don't maintain the container size.

       

      So, how do I ensure when a button is pressed for a particular swf, that it stays within the confines of the container?  To see what I'm trying to do, here is the site:

      http://webspace.westwood.edu/student...ter_movie.html

       

      Some of the buttons aren't working yet. However, the Drag and Drop one does for sure...just out of scale of the container.

       

      I'm experimenting with how to do this by this code by using loadMovie and loadMovieNum. I believe I'm supposed to use loadMovie if I want it to be inside a container. Any suggestions, tips, advice, or help would be greatly appreciated. I know the code is messed up in parts, but I was just trying to see which one gave me the best result...none did what I wanted it to do,

       

       

      Code:
      stop();

      jukebtn.onRelease = function ()
      {

          loadMovie ("BKjukebox.swf", empty_mc);
          empty_mc._xscale = 90;
          empty_mc._yscale = 90;
          empty_mc._x = 65;
          empty_mc._y = 65;
      }

      sshowbtn.onRelease = function ()
      {

          loadMovieNum ("slideshow.swf", 10);

      }

      gamebtn.onRelease = function ()
      {

          empty_mc.loadMovie ("drag_drop.swf");
          empty_mc._xscale = 90;
          empty_mc._yscale = 90;
          empty_mc._x = 65;
          empty_mc._y = 65;

      }

      dynambtn.onRelease = function ()
      {

          loadMovieNum ("dynamic_text.swf", 10);

      }
        • 1. Re: Help! How to make external SWF's fit inside a container
          kglad Adobe Community Professional & MVP

          when loading is complete, resize empty_mc.

           

          you might findi it easier to use the moviecliploader class rather than code your own loop to determine when loading is complete.

          1 person found this helpful
          • 2. Re: Help! How to make external SWF's fit inside a container
            SoloXX007 Level 1

            These swf's are not big so they ALMOST loat instanteously.  I just couldn't get the external swf's to recognize the container boundaries. So, instead I created containers manually which allows me to position and scale the swf exactly where I want them. I got this information through scouring many forums trying to get the picture of what I must do. The code below is just for one button (no need to post all code since they are essentially the same)  Found this code works :

             

            sshowbtn.onPress = function () {

            _root.createEmptyMovieClip("container", 5);

            loadMovie("sshow.swf", "container");

            container._xscale = 65;

            container._yscale = 65;

            container._x = 360;

            container._y = 60;

            }