# Preloader in second frame

**URL:** <https://forum.kirupa.com/t/preloader-in-second-frame/64248>\
**Category:** flash\
**Created:** [September 14, 2004, 3:31pm UTC](https://forum.kirupa.com/t/preloader-in-second-frame/64248 "2004-09-14T15:31:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc0047](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@marc0047](https://forum.kirupa.com/u/marc0047)\
**Post date:** [September 14, 2004, 3:31pm UTC](https://forum.kirupa.com/t/preloader-in-second-frame/64248/1 "2004-09-14T15:31:22Z")

</div>

I am using the preloader example from the Kirupa site, but applying it to second frame. (from ‘[http://www.kirupa.com/developer/mx/percentagepreloader.htm](http://www.kirupa.com/developer/mx/percentagepreloader.htm)’).

I am creating a very simple less than 5k animation in the first frame before the preloader comes up in the second frame. What is happening is that the first frame will load with animation, but the preloader in the second frame will not show and will not advance to the third frame when the swf has completely loaded.

I’ve encased the preloader into one movie clip in the second frame, and this is what it looks like:

frame 1 of the preloader:  
bytes\_loaded = Math.round(\_parent.getBytesLoaded());  
bytes\_total = Math.round(\_parent.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
display.text = Math.round(getPercent_100) + “%”;  
bar.\_xscale = getPercent_100;  
if (bytes\_loaded == bytes\_total) {  
\_parent.gotoAndStop(3);  
}

frame 2 of the preloader:  
this.gotoAndPlay(1);

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 14, 2004, 3:46pm UTC](https://forum.kirupa.com/t/preloader-in-second-frame/64248/2 "2004-09-14T15:46:30Z")

</div>

I figured it out.

I keep forgetting that the preloader needs to play. I keep making the preceding frame instruct the second frame to ‘gotoAndStop’. So of course it’s not doing anything.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 14, 2004, 3:48pm UTC](https://forum.kirupa.com/t/preloader-in-second-frame/64248/3 "2004-09-14T15:48:56Z")

</div>

I think it should say gotoAndPlay(2) on the second frame of the preloader if you have it on the second and third frame… and if the movie is loaded it should say gotoAndPlay(4)… at least I think so… (-:

aargh… 2 minutes too late I was… :be:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 14, 2004, 4:41pm UTC](https://forum.kirupa.com/t/preloader-in-second-frame/64248/4 "2004-09-14T16:41:46Z")

</div>

It’s still a confirmation that I’m on the right track.
