3 Replies Latest reply on Aug 14, 2006 5:13 AM by I3

    how to include components into mxml file?

      I have an mxml file with multiple states and it is getting quite large. I would like to divide these states into their own components. How can i include these into the mxml file?

        • 1. Re: how to include components into mxml file?
          isml Level 1
          Adobe Flex 2 Help -->Creating and Extending Flex 2 Components
          describes how to create custom Flex components in MXML and ActionScript.

          Adobe Flex 2 Help -->Building and Deploying Flex 2 Applications --> Building Flex Applications
          describes how to compile your application if it references external components that are in other directory or in swc files.
          • 2. how to include components into mxml file?
            Dr._Goomba Level 1
            So i have code that looks like:

            <cfComponents:Shipping id="shipping1"/>

            <mx:State name="billingHistory">
            <mx:RemoveChild target="{shipping1}"/>
            <mx:AddChild relativeTo="{hbox4}" position="lastChild" target="{shipping1}"/>
            <mx:State name="payment">
            <mx:State name="rentalHistory">

            The component must be loaded outside of the states. This makes the components visible in the start state. Dont want this. Is there a better way to go about including or even braking the main mxml file into smaller components so they are easier to manage?

            • 3. Re: how to include components into mxml file?
              I couldn't be happier that you asked this question and if you don't mind I'd like to extend on it a touch since it directly relates to my topic.

              I am right with Dr. Goomba (Great name) when it comes to filesize of a single application.

              The flash player has always been a big proponent of small file size and fast dowloads to ensure our users have a pleasant experience in our applications. I have been going through the documentation tirelessly and the only mention I really see as a supporter of that theory is "RSL" documentation which, believe it or not, actually advises against them unless you are using them across multiple apps.

              So, my question is a tack on to Dr. Goomba (Answer his first, this is just a supporter):

              Has Flex 2 moved us away from fast delivery? I have an application already up to 300k that could easily reach the 700k range (I think, based on my total progress so far) - It doesn't seem to me that the focus is still on loading things in parts like the MX 2004 RIA days.