Organizing Flex Custom components

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

  1. #1

    Default Organizing Flex Custom components

    This may sound dumb, but for me unorganized projects is one of my biggest pet
    peves.

    I have a project that I am working on that uses alot of custom components.
    Normally I would use just <componentname />

    Now the question I have is, if I want to brek these down into sections
    (folders) and have only my index.mxml file in the top webroot folder. How would
    I use my custom componets.

    IE.

    webroot
    Index.mxml
    status (this is a folder)
    addSale.mxml

    Ok so I have the index.mxml and the folder status under my webroot directory
    for the project. How would I use my custom compoent under the status folder.
    Would it be something like <status/addSale.mxml />. Or is there something else
    I need to do.





    rottmanja Guest

  2. Similar Questions and Discussions

    1. Problems running custom components with Flex
      Hi, I'm trying to follow the tutorial in this PDF document (Chapter 2:Creating Basic Components in Flash MX 2004): ...
    2. How to load Flex 2.0 components on Flex 1.5 application
      Hello, I am currently working on an Flex 1.5 application and my client wants to import 2.0 components into it. Can we achieve that? if so how is...
    3. Flex 2B2 UI COmponents
      Hi All... I am trying to get an application prototyped fairly quickly. Initially, I started using a Java Applet but there is a good bit of high...
    4. can custom-made flash components use flex drag-and-drop?
      hello, I am making a visual component in the flash IDE that I want to then incorporate into a flex application. If possible, I would like to have...
    5. Custom Components
      I've built some flash MX components for use by my team. I'd like to know how to make the component update on the stage at design-time when the...
  3. #2

    Default Re: Organizing Flex Custom components

    Look in the docs for "namespace".

    Basically, in your application tag you declare a namespace like this:
    xmlns:myns="status/*"

    Then you can do:
    <myns:addSale ..../>

    That's just from memory, you will want to look it up.

    Tracy

    ntsiii Guest

  4. #3

    Default Re: Organizing Flex Custom components

    If component files are in the same directory as the application file or in the
    ActionScript classpath directory (not a subdirectory), you can refer to them as
    the following example shows. In this example, the component's namespace (*) is
    mapped to the prefix MyComp.

    <mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml"
    xmlns:MyComp="*">
    <MyComp:MyButton/>
    ...
    <mx:Application>

    #

    If the same file exists in the ActionScript classpath directory and the
    application directory, Flex uses the file in the application file directory.
    # If the component is in a subdirectory of the directory that contains the
    MXML application file, you use a namespace that specifies the subdirectory. The
    following code declares a component that is in the custom/components
    subdirectory of the directory that contains the MXML file in which it is used:

    <m1:MyComponent xmlns:m1="custom.components.*"/>

    If the same file exists in the ActionScript classpath directory and the
    application directory, Flex uses the file in the application file directory.


    rottmanja 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