2 Replies Latest reply on Aug 4, 2010 9:07 AM by jimmyoneshot

    Accessing A Custom Component From Another

    jimmyoneshot Level 1

      Something I've been confused about for a while now is how to get components to "talk to one another" or perhaps more accurately access one another. For example in my application I have a component that contains the website banner, a component that contains the website footer a component that contains the sites main content area and a component that contains the top navigation of the site. All of these components are stored in a folder called components.


      The problem however is in my main content component I make use of a module loader called "contentLoader" and in my navigation component I have buttons that I want to change the url/module of this loader. However when I apply the code click="contentLoader.url = 'page2.swf'" I get the error "Access Of Undefined Property contentLoader".


      Is this because the two (the buttons and the module loader) are in seperate files and hence can't access each others data? Is exchanging data between controls that are in different component files tricky and requiring a lot of ActionScript or am I missing something?


      I find it useful to seperate the components in this way as I've heard it can help performance and loading times but it seems there's more to it than I expected.


      Can anyone direct me to a tutorial or give any advice on this? Any help is much appreciated