In my main application I have a result event and an XMLList, which is filled with my results. The XMLList is defined outside of a function like so:
public var testList:XMLList = new XMLList();
But within my result handler it is populated with data from the result and it works fine. I need to create an external component MXML file that will contain a List, but from within that component file I can't access testList from the main application.
I have included xmlns:local="*" in each file and my component file also has the following imports:
import mx.collections.XMLListCollection;
import mx.controls.Alert;
import mx.core.Application;
import mx.events.FlexEvent;
import mx.rpc.events.ResultEvent;
I don't understand what I'm doing wrong.
You need to pass the
testListas a property of your component.Main - you have the testList from your result event and your custom component. Pass the
testListto a property you've defined in the component, such asdata:CustomComponent - from the component you created, access the
testListfrom a property, such asdatain this example: