4 Replies Latest reply on Sep 7, 2007 3:39 AM by Karl_Sigiscar_1971

    Flex Events...

    Bob Saggot Level 1
      What is the event startup event of doing something right when it loads on your screen...

      say I go into a specific viewstate that has alot going on.. i don't want it to load when the page loads, but load specifically when somebody clicks on it to view it (in case they never even get to it, then they loaded it for no reason)

      Thanks
        • 1. Re: Flex Events...
          Bob Saggot Level 1
          Anybody have any idea how to do this?
          • 2. Re: Flex Events...
            kcell
            Hi Bob,

            its difficult to say. What did you like to load on demand?

            You may can put it into another SWF and use the SWF loader, but if the code you want to load on demand require some code in the main swf it not usefull.

            Can you seperate the code into different modules?
            If yes, you load the module afterwards ( see ModuleLoader in mx.modules package )

            best regards,
            kcell
            • 3. Re: Flex Events...
              Karl_Sigiscar_1971 Level 3

              You should look this up in the documentation:

              initialize
              creationComplete
              Deferred Instantiation

              • 4. Flex Events...
                Karl_Sigiscar_1971 Level 3
                creationCompleteEffect is a nice property to use at startup as well.

                The newest version of the Flash Player caches the Flex framework, so the weight of your Flex application will be small (if you use Flex 3).

                In our project, we have used <mx:Module> and <mx:ModuleLoader> to dynamically load a piece of content created with Flash using the Flex component kit for Flash CS3. Thanks to an Adobe consultant, we got this command line to create a module SWF from a MXML and a SWC.

                mxmlc -library-path+=swc/Cairngorm.swc,swc/project.swc -output assets/modules/ProjectModule.swf ProjectModule.mxml

                Where project.swc is the SWC created by the component kit, ProjectModule.swf is the module created by mxmlc and ProjectModule.mxml is the MXML that instantiate the Flash component and whose base node is <mx:Module>.