AS3 dynamically import external swf

Hi all, got a really confusing problem with importing one swf in to another. Both swf’s are AS3 but each one is coded differently.

I have a main swf which has very basic code in. Essentially its just a moving flv with a couple of buttons what just move the user to a different frame to show a different flv file. As it was so simple I didn’t set it up using base classes and didn’t do any OOP style code (i.e. using methods etc) as it didn’t need it. This works fine.

I have now created a new small SWF which does some functional stuff (won’t go in to details as it’ll take a while). This was a more complex peice of kit so I used classes, external .as files etc (i.e. the approved OOP style way). This on its own also works great.

Now I want to dynamically import this small swf in to the main SWF. I used the following code in my main swf…

var url:String = “smallmov.swf”;
var req:URLRequest = new URLRequest(url);
var myLoader:Loader = new Loader();
myLoader.load(req);
myLoader.x = 0;
myLoader.y = 0;
addChild(myLoader);

…which DOES import the small swf dynamically, HOWEVER the problem is, because my small swf uses classes and my MAIN swf doesn’t I get the following error…

TypeError: Error #1009: Cannot access a property or method of a null object reference.

I tried giving the main SWF a base class that was the same as the small swf (knowing that it probably woouldn’t work, because the base class fdor the small swf is technically nothing to do with the main swf) and…it gets rid of that previous error, but then causes all the expected errors i.e. wrong.

So my question is how do I import an OOP’d class/function based SWF into a more simpler none-class-based SWF?

Desperate help required. Thanks all.