Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Andrew McGivery

Andrew McGivery Avatar
Formerly Fredy

******
Legendary Studio Member

Male
5,742


September 2005
ok. so i'm working on a script. heres what i need.

right now i'm using an <embed src to play a song. is it possible to have a script refresh the page when the song is finished playing?

k

Kahless™

Kahless™ Avatar
Coding noob

****
Senior Member

280


October 2005
uhhh
well you could have a function start when the tag loads (onload) and have a timer that is set to the length of the song, when the time has passed do the window.refreh() thing or whatever it is
"In the end, we will not remember the words of our enemies, but the silence of our friends." Martin Luther King


Andrew McGivery

Andrew McGivery Avatar
Formerly Fredy

******
Legendary Studio Member

Male
5,742


September 2005
the problem with that is that its a random song everytime you load the page, so it a different time each time :\
k

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
might have to do a php one on this, since files are server side you would have to get the file size of the file before the script is run... to my knowledge anyway


Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Would you mind inserting the length of the song (in seconds) along with the song link? Cause then it can be done.

Andrew McGivery

Andrew McGivery Avatar
Formerly Fredy

******
Legendary Studio Member

Male
5,742


September 2005
no i owuldn't mind doing that. and to make your lfie easier, ehre is the code i'm currently working from:


<script>

function song() {
};

//song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/"

song = new song();
number = 0;

// songArray
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Demon Hunter - Beauty Through The Eyes Of A Predator.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Demon Hunter - Not Ready To Die.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Pillar - Bring Me Down.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Relient K - Be My Escape.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Relient K - Sadie Hawkins Dance.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Thousand Foot Krutch - This Is A Call.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Billy Talent - Nothing To Loose.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Greenday - Holiday.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Billy Talent - This Is How It Goes(1).mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Nirvana - Smells Like Teen Spirit.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Sum 41 - Peices.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Sum 41 - Chuck - 02 - No Reason.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Sum 41 - The Hell Song.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/System Of A Down - B.Y.O.B..mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/System Of A Down - Chop Suey.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Weezer - Beverly Hills.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Requiem for a Dream - Orchestral Version.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/demon hunter-my heartstrings come undone.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Newsboys - Shine.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Idiot Pilot - to buy a gun.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Demon Hunter - I Play Dead.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Demon hunter - Our Faces Fall Apart.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Demon Hunter - Through the Black.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Popa Roach - Last Resort.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/12 Stones - Broken.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/12 Stones - Lifeless.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/12 Stones - My Life.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/P.O.D. - Youth Of The Nation.mp3"
song[number++] = "http://sorak.servebbs.com/a/cheeseandcrackers/jukebox/Puddle Of Mudd - Blurry.mp3"

// keep adding items here...

increment = Math.floor(Math.random() * number);

document.write('<embed src="');
document.write(song[increment]);
document.write('">');
</script>



k

newBookmarkLockedFalling