1 Reply Latest reply on Oct 3, 2010 9:20 PM by Flex harUI

    MXML Application




      I'm fairly new to Flex and actionscript.

      I found a Flex project on the net and I managed to make it work. It is about drag and drop functionality.


      The MXML starts like this:




      xmlns="http://www.adobe.com/2006/mxml" horizontalGap="0" xmlns:qs="qs.controls.*"


      left" paddingLeft="0" paddingTop="0" paddingBottom="0" paddingRight="0" layout="horizontal"


      #343434" xmlns:ab="AlphabetClasses.*"


      /source/DragTile.zip" >


      and in the project classes I added the AlphabetBase.as where the AlphabetBase class is defined.


      I wanted to understand when and by whom is the AlphabetBase constructor?

      I thought that the fact that the AlphabetBase is used in the begining of the MXML and not the Application triggered the constructor of the AlphabetBase class. But I removed the ab:AlphabetBase(replaced it with Application), and any other refference of the AlphabetBase, and placed a brealpoint in the constructor and then while debuging it still stopped on the Breakpoint, so I assume that it is loading all the classes in the project> is that correct?


      As well, could somebody help me with the order in which the functions are executed(e.g. constructor of the Application class, then for each component in the MXML the constructor of the component... ).


      Thank you,


        • 1. Re: MXML Application
          Flex harUI Adobe Employee

          Classes should not be constructed unless used.  There is a chain of

          dependencies starting with top-level tag that will bring classes into the

          SWF, then code has to actually run that instantiates the class.  Using a

          link-report will help you see how the class got into the SWF, and putting a

          breakpoint on the constructor will help you see what code created it.