# Preloading a .swf

**URL:** https://forum.kirupa.com/t/preloading-a-swf/3773
**Category:** Uncategorized
**Created:** [September 19, 2001, 5:52pm UTC](https://forum.kirupa.com/t/preloading-a-swf/3773 "2001-09-19T17:52:03Z")
**Posts on this page:** 12
**Page:** 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 19, 2001, 5:52pm UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/1 "2001-09-19T17:52:03Z")

</div>

## is there anyway to preload a .swf file ? example: i got a button and when i press it i want some script on it telling the .swf to be preloaded before it actually comes up… i already know about

## if (\_framesloaded\>=\_totalframes) { &nbsp &nbsp &nbsp &nbsp gotoAndPlay (2); } else { &nbsp &nbsp &nbsp &nbsp gotoAndPlay (1); }

but that script is only when i got the .swf in and its on frame1…

---

<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 19, 2001, 9:19pm UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/2 "2001-09-19T21:19:05Z")

</div>

Hey sajber,  
This was a very popular question a few weeks ago on this thread. I don’t think we were able to find a way to do this. Try posting this in the ActionScript forum, I bet Thoriphes, supra, upuaut, eyezberg, dan, vts, or some of our other master flashers might know what to do 🙂

---

<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 19, 2001, 10:08pm UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/3 "2001-09-19T22:08:38Z")

</div>

you can leave the first frame of the swf you’re loading blank with a stop action in it.

then in your main movie (say you load it into level 3) loop these actions:

progress = \_level3.getBytesLoaded()/\_level3getBytesTotal()\*100;

if(progress == 100){  
\_level3.gotoAndPlay(2);  
}

you can also use that progress variable to make a nice loading bar.

good luck

---

<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 20, 2001, 6:22am UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/4 "2001-09-20T06:22:17Z")

</div>

ok tnx suprabeener ! ill try it

---

<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 20, 2001, 7:48am UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/5 "2001-09-20T07:48:40Z")

</div>

hmm cant say it worked…\*\*\*\* =(  
but on the other hand i gotta have an action before that 1 u wrote… an action that loads the .swf into the right layer !!  
else it aint nothing in the layer it is trying to load…

i know there is ways to preload the .swf before it pops up…  
but i cant figure it out mysef… ☹

u got any other suggestions ?

---

<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 20, 2001, 7:56am UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/6 "2001-09-20T07:56:07Z")

</div>

OMG!! I JUST FOUND THIS ON THE WEB!!

[www.flashkit.com/movies/S…reloaders/](http://www.flashkit.com/movies/Scripting/Preloaders/)

here is like all the preloader types in the world !!!  
and i found 1 that is exactly what im after !!! ^^

YEEEHAAAAAAAAAAAAAAWWWWWWWWWWWWW

---

<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 21, 2001, 5:58am UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/7 "2001-09-21T05:58:39Z")

</div>

Good for you… and thank you very much for posting the link… most people would have found that and never responded back to this thread. 🙂

---

<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 21, 2001, 7:07am UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/8 "2001-09-21T07:07:35Z")

</div>

np ^^

---

<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 21, 2001, 7:40am UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/9 "2001-09-21T07:40:22Z")

</div>

ey sAjber, went there but there were too many of them.  
u still remember the exact title of the one that suited ur need?

---

<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 21, 2001, 1:55pm UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/10 "2001-09-21T13:55:38Z")

</div>

ya its was named:

Preloader for external .swf files!

---

<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 22, 2001, 1:34am UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/11 "2001-09-22T01:34:46Z")

</div>

thanks, will check it out.

---

<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 22, 2001, 10:09am UTC](https://forum.kirupa.com/t/preloading-a-swf/3773/12 "2001-09-22T10:09:23Z")

</div>

youll have to make a nwe movie/swf…then insert a preloader in this movie…then u give the butten the action that u want…a \_root. action should be best in this case if you want to load this swf from another swf
