How do I access values held by a class instance from another class instance?

Hi folks, longtime user of Kirupa but never posted here before. I have to admit I pretty much ran away from Flash when AS2 came along and only used it for animation purposes over the last 5 years.

So I’m having a major crash course in AS3 in Flash CS3 and I’m not enjoying it one bit. I’m getting maybe 10mins of finished work per hour as I try to figure out the limits and rules of AS3. Quite often it seems that AS3 simply can’t do what I want it to. Anyway:

Characterchecks.as is the main class and it loads a bunch of XML into four arrays. The file starts like this:

package {
	import flash.net.*;
	import flash.xml.*;
	import flash.events.*;
	
	public class Characterchecks {
		var CategoryXMLfile:String = "categories.xml";
		public var _Categories:Array = new Array();
		public var _Backgrounds:Array = new Array();
		public var _Characters:Array = new Array();
		public var _CustomerCheck:Array = new Array();

A few functions exist to populate these arrays with the data from the XML files. In the main FLA file, I do the following:

var cc:Characterchecks = new Characterchecks();
cc.loadCategories();

[FONT=“Courier New”]loadCategories()[/FONT] is the function which populates the arrays. If I trace the contents of the arrays from within the function, they populate just fine.

If I trace the value of, say, [FONT=“Courier New”]cc._Categories[/FONT] from the main FLA, it’s empty. I’m guessing that the next line of AS in the main FLA doesn’t wait for the previously called function to complete? (This may tie in to my next problem)

My next step is that I want to display various things based on the data in the array. I have another class, Display.as which will hold all the functions to create the items on display. I thought it would be best for these to be a separate object. I wonder if I’m right?

So I declare an instance of [FONT=“Courier New”]Characterchecks[/FONT] in the main FLA and call it [FONT=“Courier New”]cc[/FONT], and then run the functions to populate the arrays… Now I create an instance of [FONT=“Courier New”]Display[/FONT] and call it [FONT=“Courier New”]cd[/FONT]. How can I get functions in [FONT=“Courier New”]cd[/FONT] to see the values of the variables in [FONT=“Courier New”]cc[/FONT]? And if the main timeline can’t tell that the functions aren’t finished filling the arrays, how is [FONT=“Courier New”]cd[/FONT] supposed to know?

I might be asking dumb questions, or maybe I’m doing things ***-backwards, I don’t know. I’d appreciate any help, I really would. This whole thing has me at the end of my tether… being the most technically advanced person in my circle of co-workers and web design friends means I have no-one to explain why things need to be done a certain way or what the best way is. I’m sure I’m missing something fundamental!

If anyone would be so kind as to reply, and include the why as well as the how, it would make my day!

Thanks you!