Interacting with external SWF

Hello all! :expressionless:

I have did a search before posting this, but could not find a simple answer to my problem.

I have developed a “player” shell SWF file. It is only 1 frame long and has AS3 script inside. The purpose of this “shell” is to:

[LIST]
[]get a string from my ASP page via flashvars [COLOR=DarkGreen](NO PROBLEM)[/COLOR]
[
]read an external SWF file with the filename = string passed in [COLOR=DarkGreen](NO PROBLEM)[/COLOR]
[]place it on the stage OR inside a newly created MovieClip and then place that on stage [COLOR=DarkGreen](NO PROBLEM)[/COLOR]
[
]trying to figure out when the imported SWF finished playing [COLOR=Red](PROBLEM)[/COLOR]
[*]trigger an external JavaScript based on that event (NOT YET IMPLEMENTED)
[/LIST]
The external SWF is a simple file that has some animations on its timeline and a stop() command on its last frame.

[COLOR=Red]**QUESTION: How do I access the properties of the imported SWF, like the number of frames? :stare:

Thank you in advance! :expressionless:
**[/COLOR]
Here is the code I have so far:

[FONT=Courier New][COLOR=Navy]import flash.display.;
import flash.events.
;
import flash.net.URLRequest;
import flash.text.*;

var f:String = “ball.swf”;
var loader:Loader = new Loader();
var swfContainer= new MovieClip();
swfContainer.name = “swfContainer”;

function preloader()
{
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
var request:URLRequest = new URLRequest(f);
loader.load(request);
addChild(swfContainer);
}

function completeHandler(event:Event):void
{
var loaderInfo:LoaderInfo = event.target as LoaderInfo;
addChild(event.target.content);
var swf:Object = loaderInfo.content;

swfContainer.addChild(loader)
swfContainer.addEventListener(Event.ENTER_FRAME, containerHandler);

}

function containerHandler(event:Event):void
{
// something will happen here
// check if the currentFrame = totalFrames
// not yet implemented
}
// start the show
preloader();[/COLOR][/FONT]