Hi!
I have some simple function in Flex in which I would like to send one of my variables to all the components used in my app... The problem is that there is lots of components in my app, and I'm not sure how to reference to my component's id... Basically, is there an easier way to do this;
private function preloadStuff():void{
// populating of bulkLoader var
var preloaderItemsList:XMLListCollection = new XMLListCollection(preloaderItems.children());
var item:XML;
for each (item in preloaderItemsList){
bulkLoader.add(item.path.toString(), {id:item.swfid.toString()});
}
bulkLoader.addEventListener(BulkLoader.PROGRESS, bulkProgress);
bulkLoader.addEventListener(BulkLoader.COMPLETE, bulkComplete);
bulkLoader.start();
// sending bulkLoader to all of components
// component ids are _01, _02, _03, etc.
_01.bulk = bulkLoader;
_02.bulk = bulkLoader;
_03.bulk = bulkLoader;
_04.bulk = bulkLoader;
_05.bulk = bulkLoader;
_06.bulk = bulkLoader;
_07.bulk = bulkLoader;
_08.bulk = bulkLoader;
_09.bulk = bulkLoader;
_10.bulk = bulkLoader;
_11.bulk = bulkLoader;
_12.bulk = bulkLoader;
_13.bulk = bulkLoader;
_14.bulk = bulkLoader;
_15.bulk = bulkLoader;
_16.bulk = bulkLoader;
_17.bulk = bulkLoader;
_18.bulk = bulkLoader;
_19.bulk = bulkLoader;
_20.bulk = bulkLoader;
_21.bulk = bulkLoader;
_22.bulk = bulkLoader;
_23.bulk = bulkLoader;
_24.bulk = bulkLoader;
_25.bulk = bulkLoader;
_26.bulk = bulkLoader;
_27.bulk = bulkLoader;
_28.bulk = bulkLoader;
_29.bulk = bulkLoader;
_30.bulk = bulkLoader;
_31.bulk = bulkLoader;
_32.bulk = bulkLoader;
_33.bulk = bulkLoader;
_34.bulk = bulkLoader;
}
Thank you very much for any help!