hello,

i have a swf that should be able to load another swf in runtime.

then i would like the loaded swf to call a method of the parent, loader swf, like this:

Code:
parent.closeForm;
but when i compile it, it throws this error :

1119: Access of possibly undefined property closeForm through a reference with static type flash.displayisplayObjectContainer.
i´ve tried:

Code:
if (parent != stage)
{
	parent.closeForm;
}
so flash won´t run this code at compile time, but it always throws that error.

here is the code of the LOADER swf:

Code:
private function loadForm():void
{
	var loader:Loader = new Loader() 
	var mRequest:URLRequest = new URLRequest(formPath);
	loader.load(mRequest);
	loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onFormCompleteHandler);
}
		
private function closeForm():void
{
//  some alpha tween for the LOADED swf, for example, and then onComplete: close somehow
}
however, if i put this code in the LOADED class, it works:

Code:
// in init function:
if (parent != stage)
{
	closeBtn.addEventListener(MouseEvent.CLICK, selfClose);
}

private function selfClose(e:MouseEvent):void
{
	parent.removeChild(this);
}
so, how could i write an expression that should call a function of the LOADER swf without having this compile-time error?

Thanks in advance!