8 Replies Latest reply on Aug 2, 2010 4:05 PM by aktell2007

    How to reduce the size of a flex webpage ??

    Vasiqullah

      I'm currently designing a website in Adobe Flex 4 and the website has a Gallery tab in it, which contains somewhere around 100 pictures and some vidoes too and because of this pictures and videos the size of the whole webpage has increased a lot which effects the performance of the website because in flex the whole website is downloaded first when you visit it on the Internet.

      So what should i do to make sure my website size is as low as possible and that it shouldn't take much time to download when visited from the Internet.

        • 1. Re: How to reduce the size of a flex webpage ??
          rootsounds Level 4

          Are you packaging these resources in the swf? If so, make them external resources.

          • 2. Re: How to reduce the size of a flex webpage ??
            VRPDeveloper Level 3

            A good option will be to import PNG images in Flash rather than GIF or JPEG.
            Secondly, if you place many blank frames in the movie to increase time  between 2 events or animations, better use the setInterval() action.  Frames add to the size of the movie.

             

            Hope it will help you!!!

             

            If this post answers your question or helps, please kindly mark it as such.

            • 3. Re: How to reduce the size of a flex webpage ??
              Vasiqullah Level 1

              External resources ??? How to do that ?

              • 4. Re: How to reduce the size of a flex webpage ??
                Vasiqullah Level 1

                The image which i had it's size was somewhere around 300 Kb which was in JPEG format but after saving it into a PNG format the

                size was around 2.7 MB....Any other solution and thanks for the answer.

                • 5. Re: How to reduce the size of a flex webpage ??
                  VRPDeveloper Level 3

                  The alternative to embedding a resource is to load the resource at run  time. You can load a resource from the local file system in which the  SWF file runs, or you can access a remote resource, typically though an  HTTP request over a network. These images are independent of your Flex  application, so you can change them without causing a recompile  operation as long as the names of the modified images remain the same.  The referenced images add no additional overhead to an application's  initial loading time. However, you might experience a delay when you use  the images and load them into Adobe Flash Player or AIR.

                   

                  http://livedocs.adobe.com/flex/3/html/help.html?content=controls_16.html

                   

                   

                  If this post answers your question or helps, please kindly mark it as such.

                  1 person found this helpful
                  • 6. Re: How to reduce the size of a flex webpage ??
                    Vasiqullah Level 1

                    Ok I got it now, all I've to do is to make sure that all the images of my website and the videos should be kept seperate and it should be loaded at runtime.

                    Thanks a lot for your help....

                    • 7. Re: How to reduce the size of a flex webpage ??
                      Vasiqullah Level 1

                      To keep the size of your Flex Website as small as possible, the external resources (like images, videos) should be loaded at runtime instead at compile time. This will save the time and the performance of the website too.

                      • 8. Re: How to reduce the size of a flex webpage ??
                        aktell2007 Level 1

                        Hi there,

                        All the above is of course right, but I think that you are still very far of the beaten track.

                         

                        If you have a .Jpeg with 300 kb why would you have to have a .Png Image do you have transparency ???

                         

                        If NOT stay with .Jpeg

                         

                        If YES, than work as long as possible with .Jpeg before changing over which means do not resize before change over, and if changed to .Png resize first !, and than use an .Png ‘Optimizer Software’ which gets you around there where the .Jpeg was.

                         

                        Now the next step would be if using either to make a .swf file out of these, which would do this:

                        A .Png Image with around 300 kb file size included into a .swf = anything between 120 to 150 kb, but that is really in the end up to the Information include in the Image itself could be more could be less. The quality is the same or better even so I find myself that the quality is always so much better in a .swf file.

                        There is also another issue with .Png and that is which of them you are using in your program PNG 8, PNG 24, PNG 32.

                         

                        Next step is to avoid the ‘Jet leg’ in showing your Images:

                        Well, Http is one of them, but I would never use it at the start of the Application - as said it leg’s.

                         

                        I myself would recommend to use modules !!! which makes this much more interesting, and would take care of so many of your problems in your App. RSL, and if you do not use the Debug or at least before publishing include in the Compiler ‘-debug=false –optimize=true’ all these little items are very effective in building up a usable and speedy Application.

                         

                        What you need is maybe to embed the first Image and use in the background a blind Preloader / Loader, and possible one, which is caching the Images as well, once preloaded.