# Load SWFs in the background

**URL:** <https://forum.kirupa.com/t/load-swfs-in-the-background/259762>\
**Category:** Uncategorized\
**Created:** [May 8, 2008, 3:11pm UTC](https://forum.kirupa.com/t/load-swfs-in-the-background/259762 "2008-05-08T15:11:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhikumar](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@abhikumar](https://forum.kirupa.com/u/abhikumar)\
**Post date:** [May 8, 2008, 3:11pm UTC](https://forum.kirupa.com/t/load-swfs-in-the-background/259762/1 "2008-05-08T15:11:10Z")

</div>

i have multiple SWFs loading on multiple button clicks. so by default i have one.swf loaded on the screen. now when button two is clicked i load two.swf replacing one.swf. similarly when button three is clicked i load three.swf.

is there anyway i can preload two.swf, three.swf and other swf files in the background so that when user clicks on the button to view these, the swf is already loaded and takes no time to appear.

please let me know.

---

<div class="post-metadata">

**Author:** ![rumblesushi](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@rumblesushi](https://forum.kirupa.com/u/rumblesushi)\
**Post date:** [May 8, 2008, 4:32pm UTC](https://forum.kirupa.com/t/load-swfs-in-the-background/259762/2 "2008-05-08T16:32:25Z")

</div>

.\_visible always works, try false instead of 0.

Or simply move them off the stage, or delete them completely, then attach them when needed.

---

<div class="post-metadata">

**Author:** ![abhikumar](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@abhikumar](https://forum.kirupa.com/u/abhikumar)\
**Post date:** [May 8, 2008, 5:17pm UTC](https://forum.kirupa.com/t/load-swfs-in-the-background/259762/3 "2008-05-08T17:17:11Z")

</div>

i tried- visible false also does not work… okay here is what i have:

i have 5 blank movie clips which i have on my main swf file.

\_root.blank1.loadMovie(“one.swf”);  
\_root.blank2.loadMovie(“two.swf”);  
\_root.blank3.loadMovie(“three.swf”);  
\_root.blank4.loadMovie(“four.swf”);  
\_root.blank5.loadMovie(“five.swf”);

the movie clip blank1 loads by default on top of every blank movie clip (may be because of the stacking order)

now on click of button 2 i have this:  
\_root.blank1.loadMovie(“two.swf”);

similarly, on click of button 3 i have this  
\_root.blank1.loadMovie(“three.swf”);

so- now when i really have to view those SWF files, i load them on BLANK 1 movie clip and just to keep them loaded on the screen, i use blank2, blank3 etc.

and i was wondering if there was a better way…

---

<div class="post-metadata">

**Author:** ![rumblesushi](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@rumblesushi](https://forum.kirupa.com/u/rumblesushi)\
**Post date:** [May 8, 2008, 5:23pm UTC](https://forum.kirupa.com/t/load-swfs-in-the-background/259762/4 "2008-05-08T17:23:47Z")

</div>

And when you’ve tried the .\_visible command, how are you targetting the MCs and from where?

---

<div class="post-metadata">

**Author:** ![abhikumar](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@abhikumar](https://forum.kirupa.com/u/abhikumar)\
**Post date:** [May 8, 2008, 5:49pm UTC](https://forum.kirupa.com/t/load-swfs-in-the-background/259762/5 "2008-05-08T17:49:10Z")

</div>

i don’t know if i got ur question right- but like i said- blank1, the blank MC loads MC1 by default  
\_root.blank1.loadMovie(“MC1.swf”);

and when a button, button 2 is clicked i load MC2:  
\_root.blank1.loadMovie(“MC2.swf”);

not sure this is what u wanted to know.

---

<div class="post-metadata">

**Author:** ![rumblesushi](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@rumblesushi](https://forum.kirupa.com/u/rumblesushi)\
**Post date:** [May 8, 2008, 7:24pm UTC](https://forum.kirupa.com/t/load-swfs-in-the-background/259762/6 "2008-05-08T19:24:15Z")

</div>

No, what I wanted to know is when you’ve tried \_visible = false; - how have you done it?

---

<div class="post-metadata">

**Author:** ![abhikumar](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@abhikumar](https://forum.kirupa.com/u/abhikumar)\
**Post date:** [May 8, 2008, 7:59pm UTC](https://forum.kirupa.com/t/load-swfs-in-the-background/259762/7 "2008-05-08T19:59:14Z")

</div>

i tried both:

\_root.blank1.\_visible = 0; and \_root.blank1.\_visible = false;

* * *

## \_root.blank2.loadMovie(“two.swf”); \_root.blank2.\_visible = false;

so here i wanted to load the two.swf and at the same time- keep it hidden.

---

<div class="post-metadata">

**Author:** ![Macsy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/macsy/32/3238_2.png) [@Macsy](https://forum.kirupa.com/u/Macsy)\
**Post date:** [May 8, 2008, 8:03pm UTC](https://forum.kirupa.com/t/load-swfs-in-the-background/259762/8 "2008-05-08T20:03:54Z")

</div>

use onLoadStart or onLoadInit with movieClipLoader and apply the statement there.
