Ranoka
July 22nd, 2003, 06:32 PM
Hi everyone,
I'm only just learning Actionscript, and have come up with a piece of code that I want to get working.
On my main timeline I have a movieclip with an instance called "eye". What I would like to happen if for a random number to be generated and assigned to "blink". If blink = 20 then I want to play "eye"s animation. This is the code I have so far:
blink=Math.random(20)
if(blink=20){
_root.eye.gotoAndPlay(2)
}
I've told the eye animation to stop() in the first frame to stop it from animating before being told.
I know this won't work yet, I haven't worked out how to put this code in a loop to keep generating a new value for blink, and test if it is 20.
Any help with finishing my code will great! :beam:
Thanks in advance!
I'm only just learning Actionscript, and have come up with a piece of code that I want to get working.
On my main timeline I have a movieclip with an instance called "eye". What I would like to happen if for a random number to be generated and assigned to "blink". If blink = 20 then I want to play "eye"s animation. This is the code I have so far:
blink=Math.random(20)
if(blink=20){
_root.eye.gotoAndPlay(2)
}
I've told the eye animation to stop() in the first frame to stop it from animating before being told.
I know this won't work yet, I haven't worked out how to put this code in a loop to keep generating a new value for blink, and test if it is 20.
Any help with finishing my code will great! :beam:
Thanks in advance!