PDA

View Full Version : newbie needing help


billy
10-06-2002, 10:44 PM
how can i put text on the page 1 letter at a time like its typing with a sound, when its finished the sound stops, i need help on both please i have the sound, usless you can point me to some good ones
thx
:thumbsup:

Eternity Angel
10-06-2002, 10:56 PM
I did that once for an eCard for my g/f, but I didn't add sound... And I deleted the script, so I actually can't help you, so I don't even know why I am telling you this!

*searches for the script*

Mr J
10-06-2002, 11:04 PM
Hi

Try this out, change the sound file src to your own otherwise if no sound file is found an error message is generated



<script language="javascript">
<!--
var word="A Simple Repeat Text Scroller"
//var display=""
var nextcol=0
var nextchar=0
var speedout=100
var speedin=1
var pause=1000

col= new Array()
col[col.length]="#00ff00"
col[col.length]="#aaaa00"
col[col.length]="#ff0000"
col[col.length]="#0000ff"

function type(){
document.all.sound.play() // for playing sound as the text becomes visible document.all.display.style.color=col[nextcol]
document.all.display.innerText=document.all.display.innerText+word.charAt(nextchar)
nextchar++
timerT=setTimeout("type()",speedout)

if(nextcol==col.length){
nextcol=0;}

if(nextchar==word.length){
clearTimeout(timerT)
nextchar=0
setTimeout("type2()",pause)}
}

function type2(){
document.all.display.innerText=document.all.display.innerText.substring(0,document.all.display.inner Text.length-1)
timerT2=setTimeout("type2()",speedin)

if(document.all.display.innerText.length==0){
nextcol++
clearTimeout(timerT2)
count=word.length
document.all.display.innerText=""
setTimeout("type()",2000)}
}
setTimeout("type()",2000)
// -->
</script>

<EMBED name="sound" SRC="type.au" loop=false autostart=false hidden=true mastersound>

<span id="display" style="position:absolute; top:10; left:100; width:450;font-size:25;color:black"></span>

chrismiceli
10-06-2002, 11:23 PM
if you read the posting guidlines it says do not post titles such as "n00b needing help"

billy
10-07-2002, 12:35 AM
thx but i am much a beginner, do i have to have a new doc with the words in, please can you highlight what to do,

thanks for you help:thumbsup:

Mr J
10-07-2002, 02:52 PM
Copy the script into the HEAD section and the rest into the BODY section.

Don't forget to name your sound file in:


<EMBED name="sound" SRC="YOUR SOUND FILE" loop=false autostart=false hidden=true mastersound>

billy
10-07-2002, 02:56 PM
Thx i will give it a go .

billy
10-07-2002, 03:04 PM
okay the sound works but all the text is there right a way, do i have to but the text in the script some where.

cheers m8

Mr J
10-07-2002, 07:51 PM
What is your browser?

billy
10-07-2002, 10:39 PM
the one that comes with XP, if any help