3 Replies Latest reply on Apr 28, 2010 10:19 PM by mohinder_ghumman

    how to load dynamically in flex

    mohinder_ghumman

      hi

      i dont want to  embed content that’s not required immediately to be shown as application initializes.. i want to  Load assets at runtime. For example if you want to show a window containing thumbnails on user click ,i dont want to  embed or load them on application initialize, just load them when user clicks to show that window...pleaes provide with some pointers

        • 1. Re: how to load dynamically in flex
          David_F57 Level 5

          hi,

           

          there are several ways you can dynamically load objects in flex, the critical part which tends to be forgotten is that you need to ensure that the object is fully loaded before displaying it.

           

          As an example the following allows you to load images from your hard disk and display them in a list, the process of using loaders and load complete functionality is similar whether using a file reference or an url reference.

           

          the example gets a list of files then loops through them it loads an image then when it has that image it displays it then moves onto the next image in the file list.

           

          http://gumbo.flashhub.net/pagedrop/  source included (this also has basic drag n drop functionality as well you can drag the image from the list and drop it on the canvas);

           

           

          David.

          • 2. Re: how to load dynamically in flex
            mohinder_ghumman Level 1

            hi

            1)i am not able to open the page ...can u please send me the code

            2) i am working on a project where i have to optimise the things .i am looking for an approach where u dont load all the modules at one go ...like i have a menu where there are 20 submenu  ...i dont want to load all submenus at one go(during initialization ) ... suppose if user clicks on sub menu number 5 then all pages related to it will get loaded at that time .

             

             

            please do help me .. i need them urgently

            • 3. Re: how to load dynamically in flex
              David_F57 Level 5

              hi,

               

              can't do attachments so to get the zip file directly  (others have no trouble accessing the link not sure why you can't see it).

               

              http://gumbo.flashhub.net/pagedrop/srcview/pageedit.zip

               

              Now your question has changed a little, there is a big difference between external asset management and modular design. I'm not sure what you want to do but it sounds like you need to look at a few things like using modules either with swf loader or module manager, also states can come into play with a 'modular' design. I suggest you familiarise yourself with dynamically loading assets, using individual swf's with your application and using states to display 'pages' of information. This will probably give you a btter idea of the best option for the design of your application.

               

               

              David.