Thread: Flash Request
View Single Post
Old 12-05-2003   #6 (permalink)
malboroman
Lazarus' Child
 
malboroman's Avatar
 
Join Date: Nov 2003
Location: The Netherlands
Posts: 603

Send a message via MSN to malboroman Send a message via Skype™ to malboroman
Well this is going to take us to an entirely different side of webdesign. Because it can't be done in flash, but It can in Javascript. You also get an preload bar and for the sound you can put in a small (transparant) flash file. Here's the script that can make that happen.

You have to make a separate html-page as preloader,
between <HEAD> and </HEAD>
you have to put this code(you will have to modify it)

--------------------------------------------------------------------------------

<script language="JavaScript1.1">
<!-- begin hiding// You may modify the following:

var locationAfterPreload= "http://www.klootzakken.f2s.com/klootzakken.htm"
var lengthOfPreloadBar = 250 // Length of preload bar (in pixels)
var heightOfPreloadBar = 25 // Height of preload bar (in pixels)//Put the URLs of images that you want to preload below (as many as you want)
var yourImages = new Array("http://www.klootzakken.f2s.com/bgkeuze.jpg",
"http://www.klootzakken.f2s.com/Collapse.gif",
"http://www.klootzakken.f2s.com/logo1.gif",
"http://www.klootzakken.f2s.com/logo1.jpg",
"http://www.klootzakken.f2s.com/menu_home.gif",
"http://www.klootzakken.f2s.com/menu_links.gif",
"http://www.klootzakken.f2s.com/menu_overhen.gif",
"http://www.klootzakken.f2s.com/menu_reageer.gif",
"http://www.klootzakken.f2s.com/menu_sollici.gif",
"http://www.klootzakken.f2s.com/menu_telnum.gif",
"http://www.klootzakken.f2s.com/menu_vragen.gif",
"http://www.klootzakken.f2s.com/menu_vrijwil.gif",
"http://www.klootzakken.f2s.com/welkom.jpg",
"http://www.klootzakken.f2s.com/download.gif",
"http://www.klootzakken.f2s.com/download2.gif",
"http://www.klootzakken.f2s.com/adspir.gif",
"http://www.klootzakken.f2s.com/agent.gif",
"http://www.klootzakken.f2s.com/briga.gif",
"http://www.klootzakken.f2s.com/comm.gif",
"http://www.klootzakken.f2s.com/copmeet.jpg",
"http://www.klootzakken.f2s.com/hoofd_a.gif",
"http://www.klootzakken.f2s.com/hoofd_ins.gif",
"http://www.klootzakken.f2s.com/hoofdcom.gif",
"http://www.klootzakken.f2s.com/inspect.gif",
"http://www.klootzakken.f2s.com/surv.gif")

// Do not modify anything beyond this point

!if (document.images) {
var dots = new Array()
dots[0] = new Image(1,1)
dots[0].src = "black.gif" // default preloadbar color (note: You can substitute it with your image, but it has to be 1x1 size)
dots[1] = new Image(1,1)
dots[1].src = "blue.gif" // color of bar as preloading progresses (same note as above)
var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0
var loaded = new Array(),i,covered,timerID
var leftOverWidth = lengthOfPreloadBar%coverage}function loadImages() {
for (i = 0; i < yourImages.length; i++) {
preImages = new Image()
preImages[i].src = yourImages[i]
}
for (i = 0; i < preImages.length; i++) {
loaded[i] = false
}
checkLoad()}function checkLoad() {
if (currCount == preImages.length) {
location.replace(locationAfterPreload)
return
}
for (i = 0; i <= preImages.length; i++) {
if (loaded[i] == false && preImages[i].complete) {
loaded[i] = true
eval("document.img" + currCount + ".src=dots[1].src")
currCount++
}
}
timerID = setTimeout("checkLoad()",10) }

// end hiding -->
</script>
------------------------------------------------------------------------------------

This should do it... don't ask me anything more about javascript 'cause I know about it...
But I found this script on flash site were I hover around in the forums once in a while.

Hope this will do it for you...

you could also try to implent this javascript in a flash file, but that's gonna be extremely hard to do... if you are willing to try that you could check out flashkit, it's an awesome flash resource site. You can find almost anything there...
__________________


"Only the dead have seen the end of war."

- Plato

Last edited by malboroman; 12-05-2003 at 02:41 AM.
malboroman is offline