Opening .mxml components via ActionScript

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Opening .mxml components via ActionScript

    I am working on a dynamic TabBar that will populate a datagrid under each tab
    with reports from a document archive. I want to build my datagrid in a separate
    ..mxml file and pull it in via ActionScript when I build the tabs.

    Has anyone found a way to integrate other .mxml files via ActionScript? I know
    I can do this in .mxml itself.

    dzlmbq Guest

  2. Similar Questions and Discussions

    1. Where I can get a mxml components list?
      Where I can get a mxml components list? Each component should match a class, but help has no a List. Some components has a mx as prefix, but others...
    2. Working with MXML Components
      :confused; I have a list box defined in an mxml component file. Then in the mxml application file I point to the component file by specifying the...
    3. synchronous actionscript vs mxml
      Hi for making synchronous call with java method from as file i got example from http://www.adobe.com/devnet/flex/articles/flexfaq.html link 31Q. But...
    4. using MXML in ActionScript
      Hello, There are many chapters describing how to use 'ActionScript in MXML' but I have found none about the opposite : how to perform the...
    5. ActionScript vs. MXML
      Hello. Just curious if there is any difference in building components with straight Actionscript as opposed to a mix of MXML and Actionscript? ...
  3. #2

    Default Re: Opening .mxml components via ActionScript

    Look into the createChild() method on containers. It allows you programatically create components.

    Tracy
    ntsiii Guest

  4. #3

    Default Re: Opening .mxml components via ActionScript

    I was hoping I could pull in an external .mxml file in my action script. I had
    played with createChild first but ran into a snag. Is there a way to have the
    new control size to 100% width and height? I can set it to static width/heigth.



    var newTab = reportDetails.createTab( mx.containers.VBox,
    tabLabel,
    tabData );

    reportDetails.selectedChild = newTab;

    newTab.createChild(mx.controls.DataGrid, undefined,
    {dataProvider:dp, labelField:"Unit", width:"100%", height:"100%"});

    dzlmbq Guest

  5. #4

    Default Re: Opening .mxml components via ActionScript

    If what you have is not working, try this:

    var newControl = newTab.createChild(mx.controls.DataGrid, undefined,
    {dataProvider:dp, labelField:"Unit"});
    newControl.width = "100%";

    I don't know that that will work, but it is worth a try.
    Tracy

    ntsiii Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139