Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why does this code only play 4 flash files then stop?

Status
Not open for further replies.

Toastie

Programmer
May 19, 2001
123
AU
someone please help cos i am completely baffled


<script ID=&quot;clientEventHandlersJS&quot; LANGUAGE=&quot;javascript&quot;>
<!--
function stopErrors() {
return true;
}
window.onerror = stopErrors;

var flaarray=new Array()
flaarray[0]=&quot;cat.swf&quot;
flaarray[1]=&quot;station-id.swf&quot;
flaarray[2]=&quot;cat.swf&quot;
flaarray[3]=&quot;station-id&quot;
flaarray[4]=&quot;knight.swf&quot;
flaarray[5]=&quot;station-id.swf&quot;
var count
count=0

function check()

{

if (document.f1.fla.FrameNum>=document.f1.fla.TotalFrames-15 && count<=5)
{

document.f1.fla.Movie=flaarray[count]
count++


}
tt=setTimeout(&quot;check()&quot;,100)
}



function window_onload() {
document.f1.fla.Loop = false

check()
}

//-->
</script>
 
Hiya,

I've adjusted your check function just a little.

function check()
{
if (document.f1.fla.FrameNum>=document.f1.fla.TotalFrames-15 && count<=5)
{
document.f1.fla.Movie=flaarray[count]
count++
}
if (count == flaarray.lenght) count = 0;
setTimeout(&quot;check()&quot;,100)
}

Hopefully this will make it work?

Gtz,

Kristof

PS: Shouldn't the time be longer than just 100 millisecs?
 
no it dosent work the timer is set to check repeatedly to see if the swf file is finished (well almost finished)
if it is finished go to the next file
here is all of the code on the page if it helps

<html>

<head>
<title>WackyToon TV</title>
<script ID=&quot;clientEventHandlersJS&quot; LANGUAGE=&quot;javascript&quot;>
<!--
function stopErrors() {
return true;
}
window.onerror = stopErrors;

var flaarray=new Array()
flaarray[0]=&quot;station-id4.swf&quot;
flaarray[1]=&quot;station-id1.swf&quot;
flaarray[2]=&quot;cat.swf&quot;
flaarray[3]=&quot;station-id2&quot;
flaarray[4]=&quot;knight.swf&quot;
flaarray[5]=&quot;station-id3.swf&quot;
var count
count=0

function check()

{

if (document.f1.fla.FrameNum>=document.f1.fla.TotalFrames-15 && count<=6)
{

document.f1.fla.Movie=flaarray[count]
count++


}
tt=setTimeout(&quot;check()&quot;,100)
}



function window_onload() {
document.f1.fla.Loop = false

check()
}

//-->
</script>
</head>

<body LANGUAGE=&quot;javascript&quot; onload=&quot;return window_onload()&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; bgcolor=&quot;#000000&quot;>
<form name=&quot;f1&quot;>
<object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;
codebase=&quot; width=&quot;100%&quot; height=&quot;100%&quot; id=&quot;fla&quot;>
<param name=&quot;movie&quot; value=&quot;station-id.swf&quot;>
<param name=&quot;SCALE&quot; value=&quot;noborder&quot;>
<param name=&quot;BGCOLOR&quot; value=&quot;#000000&quot;>
</object>
</form>
</body>
</html>
 
Could it be that:

flaarray[3]=&quot;station-id2&quot;

should be:

flaarray[3]=&quot;station-id2.swf&quot;
 
oh der
stupid me

*kiss*

i love you

i have been playing with this for 4 hours now
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top