Communicate with components of an external swf

I’ve got an AS3 swf that loads an AS2 swf using the Loader class. The AS2 swf has a component in it in which i need to assign a parameter to from the AS3 swf. Here’s an example of what my code looks like:


var loader = new Loader();
loader.load(new URLRequest("as2.swf"));
addChild(loader);

MovieClip(loader.content).as2_component.xmlFilePath="xmlfile.xml";

I get an error. Please someone point me in a better direction. How do i make this work?

So i discovered the only way to communicate between two swfs is through the LocalConnection Class, or a component called ActionScript Bridge, or a scripting method known as SWF Bridge. Not being a programmer, these are all very confusing. If someone could simplify, it would be greatly appreciated.