5 Replies Latest reply on Dec 15, 2006 9:53 AM by Newsgroup_User

    printJob: resizing a .swf

    rc3rdmd Level 1
      I have a .swf file that needs resizing before printing - is there a way to do this ?

      Thanks.

      Rob Childress
        • 1. Re: printJob: resizing a .swf
          Level 7
          Rob,

          > I have a .swf file that needs resizing before printing -
          > is there a way to do this ?

          Once the SWF has been loaded, it behaves the same as any movie clip, so
          any of the MovieClip class's properties or methods will come into play. For
          example, you could set your SWF's MovieClip._width and _height properties,
          or _xscale and _yscale.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: printJob: resizing a .swf
            rc3rdmd Level 1
            How do I reference the loaded .swf file?

            I am currently this code to load the .swf file:

            myMCL.loadClip("myFile.swf", 5);

            And then referencing level 5 to print from printJob.
            • 3. Re: printJob: resizing a .swf
              Level 7
              Rob,

              > How do I reference the loaded .swf file?

              Either by the movie clip into which you load it ...

              > I am currently this code to load the .swf file:
              >
              > myMCL.loadClip("myFile.swf", 5);

              ... or the level.

              > And then referencing level 5 to print from printJob.

              So there you go. :) Reference _level5 to resize the SWF, as well
              (should feature the same movie clip properties). If you find difficulty
              with that, try loading the SWF into a movie clip instead.


              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."


              • 4. Re: printJob: resizing a .swf
                rc3rdmd Level 1
                The following code had no effect on the .swf file:

                myMCL.loadClip("myFile.swf", 5);

                _level5._xscale = 50;
                • 5. Re: printJob: resizing a .swf
                  Level 7
                  Rob,

                  > The following code had no effect on the .swf file:
                  >
                  > myMCL.loadClip("myFile.swf", 5);
                  >
                  > _level5._xscale = 50;

                  And it won't until your external SWF has fully loaded; otherwise, what
                  is there in that level to scale? :) Here's a quick example.

                  // instantiate an instance of the MovieClipLoader class
                  var mcl:MovieClipLoader = new MovieClipLoader();

                  // invoke MovieClipLoader.loadClip() on that instance
                  mcl.loadClip("test.swf", 5);

                  // instantiate a generic Object instance
                  var listener:Object = new Object();

                  // assign a function to the MovieClipLoader.onLoadInit
                  // event, where this listener object is the liaison
                  listener.onLoadInit = function():Void {
                  _level5._xscale = 50;
                  }

                  // subscript the MovieClipLoader instance to this listener
                  mcl.addListener(listener);


                  David Stiller
                  Adobe Community Expert
                  Dev blog, http://www.quip.net/blog/
                  "Luck is the residue of good design."