Hi guys.
i am tinkering about with an idea of setting auto slide show for a gallery that i am working on.
Reading over some post’s regarding the topic i went with using setInterval.
ActionScript Code:
[FONT=Courier New][LEFT]</p>
<p>function slideShow COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#000000]var[/COLOR] intervalId:[COLOR=#0000ff]Number[/COLOR];</p>
<p> [COLOR=#000000]var[/COLOR] count:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#000080]1[/COLOR];</p>
<p> [COLOR=#000000]var[/COLOR] maxCount:[COLOR=#0000ff]Number[/COLOR] = totalPages.[COLOR=#0000ff]text[/COLOR];</p>
<p> [COLOR=#000000]var[/COLOR] [COLOR=#0000ff]duration[/COLOR]:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#000080]5000[/COLOR];</p>
<p> [COLOR=#000000]function[/COLOR] executeCallback COLOR=#000000[/COLOR]:[COLOR=#0000ff]Void[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]trace[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#ff0000]"executeCallback intervalId: “[/COLOR] + intervalId + [COLOR=#ff0000]” count: "[/COLOR] + count[COLOR=#000000])[/COLOR];</p>
<p> [COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR]count >= maxCount[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]clearInterval[/COLOR] COLOR=#000000[/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> count++;</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> intervalId = [COLOR=#0000ff]setInterval[/COLOR] [COLOR=#000000]([/COLOR]executeCallback, [COLOR=#ff0000]“executeCallback”[/COLOR], [COLOR=#0000ff]duration[/COLOR][COLOR=#000000])[/COLOR];</p>
<p>[COLOR=#000000]}[/COLOR]</p>
<p>
[/LEFT]
[/FONT]
The code does work but the duration does not.
Function should be called every 5 seconds but instead is called every second. I know it probs my coding. Can someone see where i am going wrong.
Thanks
Paul