2 Replies Latest reply on Jan 1, 2008 4:17 AM by dr_ross

    Automatic Image Size Changing

    ilya1992
      Hello agein!,

      I finnaly completed this script with the loading image.
      But now I have an other question.

      Every image that I load is like 2500x1900 pixels... This is HUGE.
      I need the movieclip to adjust the image size automaticly to 800x600.

      When I'm trying this ON THE SOURCE MOVIECLIP:

      setProperty("_self", _xscale, "800");
      setProperty("_self", _yscale, "600");

      Its just don't go... The image becomes even bigger :(

      I tryed

      setProperty("_self", _height, "800");
      setProperty("_self", _weight, "600");

      But still - no reaction...

      Thank you!,
      ilya1992


        • 1. Re: Automatic Image Size Changing
          kglad Adobe Community Professional & MVP
          you must wait until loading is complete before trying to adjust the _width and _height. you won't want to use _xscale and _yscale the way you're using them.
          • 2. Automatic Image Size Changing
            dr_ross Level 1
            yeah the setting of _xscale and _yscale is percentage based so 800 sets it to 800% of original.
            You had the right idea with _height and _width but thats pretty old flash 4 style code so i'm guessing you're learning from an old book.

            If you've got a copy of flash later than 6 or you're using the latest free demo look up "MovieClipLoader.onLoadComplete" in the help section and use that code to load in your movie/image.

            Then in the onLoadInit handler put in the code to set the size as in the example.
            i.e.
            target_mc._height = 800;
            target_mc._width = 600;

            If you have any problems converting your loading script to the example just post it here.