PDA

View Full Version : Execute code once only in a movie?


sikth
07-23-2004, 01:44 PM
I've got a fairly normal flash movie, with a code layer that exists in frame one only. The problem is that everytime my movie loops, the code in this layer is executed. I only want the code to be executed when the flash movie is started, how would I acheive this?

smoothhabitat
07-23-2004, 02:07 PM
the cheap-o easy method in pseudo-code:

if (!doneThisBefore) {
doneThisBefore=true;
// your code here
}

Depending on your code, you might have to make that variable a global, but then your starting to make a mess. :)

sikth
07-23-2004, 02:16 PM
That did the trick, thanks alot :)