Frame number of external SWF

Hi, here’s a question from a designer, not a programmer – accept my apologies if it is obvious (hopefully it is!)

If I open an external swf-file, how can I tell it to go straight to frame 8?

var loader:Loader;
var container:MovieClip;
loader = new Loader();
container = new MovieClip();

var SWF:URLRequest = new URLRequest("name.swf");

btn.addEventListener(MouseEvent.CLICK, loadSWF, false, 0, true);

//I assume it has to go somewhere here:

function loadSWF(e:MouseEvent): void {
    loader.load(SWF);
    this.addChild(container);
    container.addChild(loader);
}

There’s more code with the receiver and localConnection, but I think that’s not relevant for this question, right?

Thanks for your help

When loader completes loading it runs an INIT event

which is in the package flash.events.Event

Add the listener:

loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);

This will execute when the swf is fully loaded so you can safely access it. Otherwise you might try to access something in the swf that hasn’t loaded yet and you’d get a null property error. You can do whatever you want in the initHandler function.

Please marry me! Thank you so much, I can’t believe I spent two days on that problem and you come up with a solution immediately. Wonderful.