# Preloader to 2nd Frame of another swf

**URL:** <https://forum.kirupa.com/t/preloader-to-2nd-frame-of-another-swf/285245>\
**Category:** flash\
**Created:** [March 29, 2009, 1:09pm UTC](https://forum.kirupa.com/t/preloader-to-2nd-frame-of-another-swf/285245 "2009-03-29T13:09:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjdelv](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jjdelv](https://forum.kirupa.com/u/jjdelv)\
**Post date:** [March 29, 2009, 1:09pm UTC](https://forum.kirupa.com/t/preloader-to-2nd-frame-of-another-swf/285245/1 "2009-03-29T13:09:07Z")

</div>

I am just wondering if anyone knows how to make it so my preloader takes me to frame 2 of the main page rather than frame 1. I have added my code below. Basically I just want it to take me to frame 2 of main.swf (which is in a separate swf to ‘main.swf’). Is there a simple way to do this?

[is there for example a way to insert a gotoAndPlay which deletes itself after its first use at the beginning of frame 1 in main.swf… just an idea!]

I need this really badly so THANK YOU SO MUCH to anyone who can help me out…

```auto
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("main.swf"));

function loop(e:ProgressEvent):void
{
   var perc:Number = e.bytesLoaded / e.bytesTotal;
   percent.text = Math.ceil(perc*100).toString();
}

function done(e:Event):void
{
   removeChildAt(0);
   percent = null;
   addChild(l);
   TweenMax.to(preFrame, 0, {alpha:0});
   TweenMax.to(preFrame, 0, {x:298.0, y:-152.0});
   TweenMax.to(percentage, 0, {x:298.0, y:-152.0});

}

import gs.TweenMax;

```
