15 Replies Latest reply on Sep 29, 2010 6:58 AM by kglad

    Dimensions of slide show

    alexee77 Level 1

      By some reason after adding of several pictures to a .swf of the same size, in full stage to the slide show, these pictures changes their dimensions when playing the movie and take less place, become not in full stage. Is it possible to make them in full stage in slide show? The code is as below.

       

      var picTotal:Number = 5;
      var lightSpeed:Number = 5;
      var delay:Number = 5000;
      var count:Number = 0;
      function init():Void {
      var white:MovieClip = this.createEmptyMovieClip("wh", 10);
      with (white) {
      beginFill(0xFFFFFF);
      lineTo(Stage.width, 0);
      lineTo(Stage.width, Stage.height);
      lineTo(0, Stage.height);
      lineTo(0, 0);
      endFill();
      }
      white.blendMode = "add";
      pastePic(_root);
      lightSpeed = -lightSpeed;
      showNext(white);
      }
      function pastePic(target_mc:MovieClip):Void {
      target_mc.attachMovie("pic"+count, "pic", 0);
      count++;
      count %= picTotal;
      }
      function showNext(clip:MovieClip):Void {
      clearInterval(showNext.intervalID);
      clip.onEnterFrame = function():Void  {
      this._alpha += lightSpeed;
      if (this._alpha<=0) {
      delete this.onEnterFrame;
      this._alpha = 0;
      lightSpeed = -lightSpeed;
      showNext.intervalID = setInterval(showNext, delay, clip);
      }
      if (this._alpha>=100) {
      this._alpha = 100;
      lightSpeed = -lightSpeed;
      pastePic(_root);
      }
      };
      }
      init();

        • 1. Re: Dimensions of slide show
          kglad Adobe Community Professional & MVP

          there's no code shown that would resize any attached movieclip.

           

          if you're resizing your stage, the attached pics would resize otherwise they'll be their original library size.

          1 person found this helpful
          • 2. Re: Dimensions of slide show
            alexee77 Level 1

            Could you please send me a sample code for resizing of movie clips?

            • 3. Re: Dimensions of slide show
              kglad Adobe Community Professional & MVP

              use:

               


               

              var picTotal:Number = 5;
              var lightSpeed:Number = 5;
              var delay:Number = 5000;
              var count:Number = 0;
              function init():Void {
              var white:MovieClip = this.createEmptyMovieClip("wh", 10);
              with (white) {
              beginFill(0xFFFFFF);
              lineTo(Stage.width, 0);
              lineTo(Stage.width, Stage.height);
              lineTo(0, Stage.height);
              lineTo(0, 0);
              endFill();
              }
              white.blendMode = "add";
              pastePic(_root);
              lightSpeed = -lightSpeed;
              showNext(white);
              }
              function pastePic(target_mc:MovieClip):Void {
              var mc:MovieClip=target_mc.attachMovie("pic"+count, "pic", 0);

              mc._width=Stage.width;

              mc._height=Stage.height;

              count++;
              count %= picTotal;
              }
              function showNext(clip:MovieClip):Void {
              clearInterval(showNext.intervalID);
              clip.onEnterFrame = function():Void  {
              this._alpha += lightSpeed;
              if (this._alpha<=0) {
              delete this.onEnterFrame;
              this._alpha = 0;
              lightSpeed = -lightSpeed;
              showNext.intervalID = setInterval(showNext, delay, clip);
              }
              if (this._alpha>=100) {
              this._alpha = 100;
              lightSpeed = -lightSpeed;
              pastePic(_root);
              }
              };
              }
              init();

              • 4. Re: Dimensions of slide show
                alexee77 Level 1

                Thank you for your advice, however, this code make no change, there is no resizing.

                • 5. Re: Dimensions of slide show
                  kglad Adobe Community Professional & MVP

                  the first problematic pic has what linkage id?

                  • 6. Re: Dimensions of slide show
                    alexee77 Level 1

                    The 1st pic has linkage id pic0, 2nd - pic1, 3rd - pic2, 4th - pic3, 5th - pic4

                    • 7. Re: Dimensions of slide show
                      kglad Adobe Community Professional & MVP

                      is pic0 sized incorrectly?  if so, drag the movieclip with that linkage id to your stage and check the properties panel.  what's its width and height?

                       

                      after you note that click delete to remove the movieclip from your stage.

                       

                      now, what are your stage dimensions?

                       

                      where are you testing?  the flash test environment or a browser?  if you're testing in a browser by opening your html, what are your html publish settings?

                       

                      and finally, what do you see when pic0 is on stage (size-wise) and what do you want?

                      • 8. Re: Dimensions of slide show
                        alexee77 Level 1

                        All 5 pictures as well as all 5 movieclips have the size 835x110 - the same as the size of stage, this is the size I need. I have tested it by your advice. However after adding code to actions - frame the size of the resulting slideshow becomes less than the size of stage, it takes only a part of stage on the top left corner of the stage.

                        It has been tested in the flash test environment. When testing it in browser the size is also shorter than 835x110, and only bottom part of the slideshow plays, the top part of the slideshow is static. I could send you .fla source for tersting, but it seems it's not possible to send files through adobe forum.

                        • 9. Re: Dimensions of slide show
                          kglad Adobe Community Professional & MVP

                          what's the following trace show:


                           


                           

                          var picTotal:Number = 5;
                          var lightSpeed:Number = 5;
                          var delay:Number = 5000;
                          var count:Number = 0;
                          function init():Void {
                          var white:MovieClip = this.createEmptyMovieClip("wh", 10);
                          with (white) {
                          beginFill(0xFFFFFF);
                          lineTo(Stage.width, 0);
                          lineTo(Stage.width, Stage.height);
                          lineTo(0, Stage.height);
                          lineTo(0, 0);
                          endFill();
                          }
                          white.blendMode = "add";
                          pastePic(_root);
                          lightSpeed = -lightSpeed;
                          showNext(white);
                          }
                          function pastePic(target_mc:MovieClip):Void {
                          var mc:MovieClip=target_mc.attachMovie("pic"+count, "pic", 0);

                          trace(mc._width+" "+mc._height);

                          count++;
                          count %= picTotal;
                          }
                          function showNext(clip:MovieClip):Void {
                          clearInterval(showNext.intervalID);
                          clip.onEnterFrame = function():Void  {
                          this._alpha += lightSpeed;
                          if (this._alpha<=0) {
                          delete this.onEnterFrame;
                          this._alpha = 0;
                          lightSpeed = -lightSpeed;
                          showNext.intervalID = setInterval(showNext, delay, clip);
                          }
                          if (this._alpha>=100) {
                          this._alpha = 100;
                          lightSpeed = -lightSpeed;
                          pastePic(_root);
                          }
                          };
                          }
                          init();

                          • 10. Re: Dimensions of slide show
                            alexee77 Level 1

                            Output is

                            835 110
                            835 110
                            835 110
                            835 110
                            835 110

                            The sizes as required, but the slideshow takes only a part of the stage.

                            • 11. Re: Dimensions of slide show
                              kglad Adobe Community Professional & MVP

                              what do you mean the slideshow only takes part of the stage?  are you loading something?

                              • 12. Re: Dimensions of slide show
                                alexee77 Level 1

                                It means that slideshow plays, but the dimensions of movieclips in slideshow are much less than those of separate movieclips - less than 835x110.

                                • 13. Re: Dimensions of slide show
                                  kglad Adobe Community Professional & MVP

                                  what's "slideshow"?  is that a component?  is it a template swf that you're loading into another swf?  something else?

                                  • 14. Re: Dimensions of slide show
                                    alexee77 Level 1

                                    Slideshow is the result made of 5 movieclips after adding a code.

                                     

                                    The sourse is uploaded here http://www.filefactory.com/file/b3b691g/n/gallery.rar

                                     

                                    Password to .rar archive is 5pictures

                                    • 15. Re: Dimensions of slide show
                                      kglad Adobe Community Professional & MVP

                                      i don't download and correct files unless i'm hired but someone else may help.