EDIT
I'm surprised that type casting as a MovieClip fails but then again I only have the code you're showing here to go by. According to the error message you can do this then :
var photoLoader:PhotoLoader = PhotoLoader(evt.target.content );
or even
evt.target.content as PhotoLoader
which is even better than casting as a MovieClip since you can directly access the properties & methods of the PhotoLoader class!
I'm not sure what your environment is and you're right, I assumed that you wanted to access the classes from the the Main class. Clearly my mistake! If you have DocumentClasses on each SWF , then it's done to the way your code is structured, you don't event need LocalConnection, you could have a Singleton Class to be used as a FrontController, a central access to the properties of both classes.
END OF EDIT
First you could cast your loader content as MovieClip, like this:
var content:MovieClip = MovieClip(evt.target.content);
mainContainer.addChild(content);
evt.target.content should be from DisplayObject type , therefore you can't access your movie clips properties.
If you need to access the properties of your loaded SWF, you should declare them like this:
private var photoViewer:MovieClip;
private var photoLoader:MovieClip;
then you could do:
photoViewer = MovieClip(evt.target.content);
mainContainer.addChild(photoViewer);
photoLoader = MovieClip(evt.target.content);
mainContainer.addChild(photoViewer);
just give a name to your loader to differentiate the MovieClips
loaderx.name = "photoLoader";
viewer.name = "photoViewer";
then you can do this
private function loadingComplete(evt:Event):void
{
switch(event.currentTarget.loader.name)
{
case "photoLoader":
photoLoader = MovieClip(evt.target.content);
mainContainer.addChild(photoLoader);
break;
case "photoViewer":
photoViewer = MovieClip(evt.target.content);
mainContainer.addChild(photoViewer);
break;
}
if( photoViewer!= null && photoLoader!= null )
evt.target.removeEventListener(Event.COMPLETE,loadingComplete);
}
After that you should be able to access your MovieClips properties like this
trace( photoLoader.dbFields );
or
var prop:Object = photoViewer.whateverNameYouGaveToYourProperty;