calling variables in different components

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

  1. #1

    Default calling variables in different components

    hi there,

    i apologise if this is a very silly question, but i am fairly new to flex and
    busy doing my first project using it and struggling to find the information i
    need.

    i have created an application that uses components for a multitude of
    different display areas. one of my areas is a component that calls 2 other
    components to create an input area and a listing area on the same page.
    i now need the listing area to populate the fields of the input area with data
    from the listing on selection of certain items in my listing. however, i cannot
    simply call them by their id as i get the error "Access of undefined property".
    how do i access the input area component's scope from within the listing
    component?

    thanks a mil',
    nikki

    nif Guest

  2. Similar Questions and Discussions

    1. Calling custom mxml components
      How to I call an mxml component from an mxml application where the first called mxml component calls another mxml component.
    2. Web Service connecting to variables not other components
      All the web services tutorials I have reviewed always demonstrate how to setup the WebServicesConnector and bound to other input components on the...
    3. Identity while calling Components in Web Services
      Have you considered taking a different approach: use authorized SQL credentials to load and run the DTS package using DSO. You could insert code...
    4. calling serviced components from asp.net
      I have a serviced component that is strong named, registered in GAC and COM+. I want to call it from a ASP.net page, everywhere I read I told to...
    5. Replacing code based on static variables to variable variables.
      Can anyone give me some help or tips in converting this code to take 2 variables that will specify the number of Pack type lines and the number of...
  3. #2

    Default Re: calling variables in different components

    If you have the id of a component you can reference its public variables and
    function by using the dot-notation. If "listing" is the id of a component and
    it has a public variable, "input" you do this:

    listing.input

    to reference the "input" variable (or whatever it is, as long as it is public).

    peterent Guest

  4. #3

    Default Re: calling variables in different components

    hi peter,

    thanks for the quick reply. this didn't initially work as the 2 components are
    sitting on the same "level"... i.e. nested inside another component.
    then i found a reference to a "parentDocument" scope and gave this a bash...
    so, parentDocument.listing.input and it worked. i hadn't realised the different
    scopes such as parentDocument, Application and parentApplication existed, or at
    least how to reference them.
    happy days! :)

    thanks again,
    nikki

    nif 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