4 Replies Latest reply on Mar 19, 2008 9:54 PM by Sreenivas R

    Detecting presence of swc files

    flashharry! Level 1
      I have developed an enterprise level dashboard app which monitors and managers user on system we deploy.
      Some of the larger deployments would like highly customized reports. My idea was to keep the global app as is, and create swc files for custom reports. I wanted to add to the main app a method that would look for the presence of a swc file as it loads and 'if' present load the swc file, if not ignore and just run as is. I know I can use load file, but I thought it would be cheesy to just encase in a try statement, I would rather detect the file correctly.

      Thanks in advanced.

        • 1. Re: Detecting presence of swc files
          Robert S Level 1

          I may be completely wrong here, but I thought the swc files were simply library files of MXML or AS scripting (among other minor assets) so the compilier could reference library files... I don't think the swc file can be used dynamically. I know that I have to re-compile my primary applications every time I change my external library files - thus they are literally compiled into the main applications...

          I think what would be a more applicable solution is a "module" that compiles seperately and could be updated as required without updating the primary application. Modules work VERY well for read-only or "pull" from the database type applications (such as charting and reporting) where you don't necessarily need to interact with the primary application.

          When you reference the "load file" you may mean a .swf file (which is the module extension)... swc is the library extension.

          • 2. Re: Detecting presence of swc files
            flashharry! Level 1
            Thanks for the, clarification, can I do a similar trick with swf files. Detect the presence and load on the fly if available.

            I'm looking at this has a plugin, one main master app and each custom chart as a plugin.

            • 3. Re: Detecting presence of swc files
              Robert S Level 1
              Short answer... yes...

              As I don't know the server technology, report type, or any other information on what exactly you are trying to accomplish - the ability of flex as a module loader is only limited by your imagination - blood, sweat, and tears - and ability in coding.actionscript...

              If the "reports" require printing - flex is very limited in it's printing capability and typically hands that off to the server - such as ColdFusion's pdf abilities... if it's simply read-only data that needs to be produced to the user and not printed - then the module can do whatever you tell it to do or produce (or a combination of both) - could be a flag in the database (or flags), could be if the data exists in the database, could be a number of ways of determining how and when to display the results..Module "a" could be loaded as x is the customer and Module "b" if y is the customer... etc.

              Hope that helps.
              • 4. Re: Detecting presence of swc files
                Sreenivas R Adobe Employee
                Yes you can detect the presence of swf files in a directory and load them and use them.