Help needed with actionscript!

Hey everyone!,

Well i’m trying to find a solution with my actionscript! I’m busy with flash media server and i got it all up and running. I’ve made an application that records my webcam and when i press play it streams my short recorded webcam movie. The recorded file will be turned into a .flv which is great. But every time when i press record again it overwrites my previous recorded .flv file. I want to be able to obtain more files then just one which overwrites itself. Now in my actionscript i’ve got these lines:

var i = 0
function publish(num) {
ns.publish(“demo”+num,“record”);
}
publish(i);
i++;

This will make my .flv file come out like this (example): “demo0.flv” instead of “demo.flv”
but now it still overwites “demo0.flv”.

Does enyone know what i have to do to solve this problem?

Thanks.