# Load problem/question

**URL:** <https://forum.kirupa.com/t/load-problem-question/25126>\
**Category:** flash\
**Created:** [July 9, 2003, 6:08pm UTC](https://forum.kirupa.com/t/load-problem-question/25126 "2003-07-09T18:08:33Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mecc444](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@mecc444](https://forum.kirupa.com/u/mecc444)\
**Post date:** [July 9, 2003, 6:08pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/1 "2003-07-09T18:08:33Z")

</div>

Hello all and thanks for the help. My question:

How do I get a SWF file to load/play AFTER the rest of the page has loaded. The ‘rest of the page’ consists of HTML and images in jpeg and gif format. When I load the page, the flash SWF begins to play immediatly and the graphics on the rest of the page lag behind. On broadband there isn’t a problem, but I need this to load and play on a modem connection AFTER the page loads. The URL I am working on is:

[http://65.216.48.82/default2.htm](http://65.216.48.82/default2.htm)

The page needs to load and THEN the SWF needs to play. Any suggestions guys/gals? Thank you very much. and btw… nice site Kirupa! It’s been VERY helpful to me.

mecc444

---

<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:** [July 9, 2003, 6:10pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/2 "2003-07-09T18:10:58Z")

</div>

THe site looks nice to tell you the truth really well done.  
To tell you the truth i really don’t know

---

<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:** [July 9, 2003, 6:15pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/3 "2003-07-09T18:15:57Z")

</div>

Thanks Warlord. Maybe someone out thar can solve this thing.

---

<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:** [July 9, 2003, 6:18pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/4 "2003-07-09T18:18:13Z")

</div>

I would try using javascript to determine if the page is loaded, if it is, it should send a variable to your flash movie, if you want I could give you the code

---

<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:** [July 9, 2003, 6:19pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/5 "2003-07-09T18:19:18Z")

</div>

Seticus, that would rock. I appreciate the help. Send code when you can and any instructions I might need to make it work! Thanks!

mecc444

---

<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:** [July 9, 2003, 6:39pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/6 "2003-07-09T18:39:51Z")

</div>

🙂 here it is, first: the javascript:

```php

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function checkloaded() {
window.document.myFlash.SetVariable("myVar", "loaded");
}
</script>
</HEAD>
<BODY OnLoad="checkloaded()">

...

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/
flash/swflash.cab#version=5,0,0,0"
width=366 height=142 **id="myFlash"** >
<embed src="javascript_to_flash.swf" quality=high width=366 height=142
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?
P1_Prod_Version=ShockwaveFlash" 
**name="myFlash" swLiveConnect="true"** >
</embed> 
</object>

...

</BODY>
</HTML>

```

Now this is how your html-file should look like, make sure your flash-html tag is provided with the things I’ve indicated.

Second: Flash AS, make a new movieclip out of your moviebackground so nobody can see it and give it these actions

[AS]  
onClipEvent (enterFrame) {  
if (\_root.myVar == “loaded”) {  
\_root.play();  
}  
}  
[/AS]

Your first frame should be completely empty and should have a “stop”-command. Your content should begin on the second frame

That’s all, I didn’t test it so give it a try…

---

<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:** [July 9, 2003, 6:41pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/7 "2003-07-09T18:41:22Z")

</div>

about=javascript  
and… the first frame should contain the mc that’s not visible(so it’s not completely empty), but nothing exept that, that’s the only frame where the mc should 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:** [July 9, 2003, 6:44pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/8 "2003-07-09T18:44:48Z")

</div>

Going to test it in a minute. Thanks a bunch!

---

<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:** [July 9, 2003, 8:07pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/9 "2003-07-09T20:07:30Z")

</div>

Ok, Seticus, your code worked fine but I hit another ‘snag’. It seems that the Flash file is still loading in the background, thus slowing down the page load time. It still takes the same amount of time to load the page only the Flash file isn’t playing. Is there any way I can load the page and then load the Flash file. The file comes in fine on a modem conncection… so I just need it to play… not to load until the rest of the screen is loaded. thanks again for the code! worked perfect… any ideas on the new prob?

---

<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:** [July 9, 2003, 8:09pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/10 "2003-07-09T20:09:56Z")

</div>

I just reread my last post. It’s kind of confusing. Your script worked perfect. BUT, the Flash SWF was loading in the background (i think) because it took forever for the pages HTML and images (gif, jpgs) to load. then the SWF kicked in like it was supposed to. anyway to wait on the SWF load until the page loads? Hope this makes sense.

---

<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:** [July 9, 2003, 10:11pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/11 "2003-07-09T22:11:03Z")

</div>

It does make sense, in that case the easiest way to do it, is to load everything in flash. This is what you should do:

1. cut the first frame out of your movie (the one with the invisible mc) and make a new flash-file (the same size) paste your frame in there

2. make a second frame in that movie next to the empty frame, give the frame these actions:

[AS]  
loadMovieNum(“ **yourflash-file.swf** ”, 2);  
[/AS]

“yourflash-file.swf” is your movie, the one you have cutted the first frame out of. the other movie, the blank one should be in your html-tag, that’s the one that should be shown…

It’s not so difficult, but it’s hard to explain, let me know if you don’t understand.

---

<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:** [July 10, 2003, 1:51pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/12 "2003-07-10T13:51:00Z")

</div>

Seticus, you are the man. I got it! Thanks for the help!! Works perfect!  
Nice meeting you and nice website. Keep in touch.

---

<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:** [July 10, 2003, 5:00pm UTC](https://forum.kirupa.com/t/load-problem-question/25126/13 "2003-07-10T17:00:11Z")

</div>

If you need my help again, you know where to find me…
