michelledebeer
Programmer
I want to change an image in a layer every minute.
I have an idea of the codeflow:
FUNCTIONS:
var remember = 0;
var minutepicture = array('1.gif','2.gif' etc...);
timer()
{
//activate pick_picture() every 6000 ms
setTimeout('pick_picture()',6000);
}
function pick_picture()
{
if (remember == 60)
remember = 0;
if (remember != 0)
remember = remember+1;
print_picture(minute_picture[remember]);
}
print_picture(picture)
{
//print picture to the layer...
// This is the real problem.
// How do I replace the content of the layer?
name_of_layer.write('<img src='+picture+'>');
}
It has been a while since I worked with JS, so I don't know if this code is actually correct. Have been working mainly with PHP lately...
Any Thoughts?
// Michelle
I have an idea of the codeflow:
FUNCTIONS:
var remember = 0;
var minutepicture = array('1.gif','2.gif' etc...);
timer()
{
//activate pick_picture() every 6000 ms
setTimeout('pick_picture()',6000);
}
function pick_picture()
{
if (remember == 60)
remember = 0;
if (remember != 0)
remember = remember+1;
print_picture(minute_picture[remember]);
}
print_picture(picture)
{
//print picture to the layer...
// This is the real problem.
// How do I replace the content of the layer?
name_of_layer.write('<img src='+picture+'>');
}
It has been a while since I worked with JS, so I don't know if this code is actually correct. Have been working mainly with PHP lately...
Any Thoughts?
// Michelle